Code for Replace cells with a Header of column.
- Design start column and end column that want to replace.- Copy cell(Header)
- Select range by F5 Go to spacial>Constants>all
(Select cells that not blank)
- Paste value(Header)
- Loop(Do While)
------------------------------------------------------------------------------------------------------------
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi80F1ZvkEpUb2SXz1HsKsrYW_zfzdVsdCBKPOFNP2ymLI2d1DIQFV544ekEpda_ratktaMtifswlB11hJaMbm2pj3OFgaB4nmyZL64-L8bxztwflOV7pen8Q-YUYl52LE6Ye076KK0nA0/s200/ReplaceDataWithHeader.jpg.tif)
Dim strCol As String
Dim lngCol As Long
lngCol = 240
Do While lngCol < 248
Cells(6, lngCol).Select
Selection.Copy
ActiveWindow.SmallScroll Down:=-18
Range(Cells(27, lngCol), Cells(8096, lngCol)).Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
ActiveSheet.Paste
Application.CutCopyMode = False
lngCol = lngCol + 1
Loop
End Sub
------------------------------------------------------------------------------------------------------------
ไม่มีความคิดเห็น:
แสดงความคิดเห็น