earthworm
Well-known Member
- Joined
- May 19, 2009
- Messages
- 759
- Office Version
- 2019
- 2016
- Platform
- Windows
I am using the below macro to apply X on empty cell in column Heading 7 . However when i play the macro this does not work and its not dynamic despite of using relative mode during macro recording . The Macro length needs to be dynamic . Please assist.
S.no | Heading 4 | Heading 5 | Heading 6 | Heading 7 |
1 | X | |||
2 | X | |||
3 | X | |||
4 | d | |||
5 | X | |||
6 | X | |||
7 | X | |||
8 | G | 10 |
VBA Code:
Sub Macro4()
'
' Macro4 Macro
'
'
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(-8, 4).Range("A1:A9").Select
ActiveCell.Offset(0, 4).Range("A1").Activate
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "X"
Range("A1").Select
End Sub