atditiljazi
New Member
- Joined
- Nov 22, 2022
- Messages
- 41
- Office Version
- 365
- Platform
- Windows
hi all,
I have tried to do a macro but nothing happens when I try it...
I want the macro to write a text in every empty cell in column L until it reaches the last row. can someone tell me where I have gone wrong? my macro is below
Sub replace_black_cell()
Dim count_row As Long
Dim count_col As Long
Dim x As Range
Dim y As Range
Sheets("order book").Activate
count_col = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
count_row = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
Set x = Range(Cells(1, 12), Cells(count_row, 12))
For Each y In x.Cells
If y = "" Then
y = "confirm"
End If
Next y
End Sub
also, how would I add data from column J into every empty cell in column M? can I add it to the current macro or would I need to make a new one?
thanks
I have tried to do a macro but nothing happens when I try it...
I want the macro to write a text in every empty cell in column L until it reaches the last row. can someone tell me where I have gone wrong? my macro is below
Sub replace_black_cell()
Dim count_row As Long
Dim count_col As Long
Dim x As Range
Dim y As Range
Sheets("order book").Activate
count_col = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
count_row = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
Set x = Range(Cells(1, 12), Cells(count_row, 12))
For Each y In x.Cells
If y = "" Then
y = "confirm"
End If
Next y
End Sub
also, how would I add data from column J into every empty cell in column M? can I add it to the current macro or would I need to make a new one?
thanks