Sub HueHue1()
Range("B2").Value2 = "=IF(A2<>"""",""Hello"","""")"
Range("B2").AutoFill Range(Range("B2"), Range("A2").End(xlDown).Offset(0, 1))
End Sub
Sub HueHue2()
For i = 2 To Range("A2").End(xlDown).Row
If Not IsEmpty(Cells(i, 1)) Then Cells(i, 2).Value2 = "Hello"
Next i
End Sub
Sub Test()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To Lastrow
If Cells(i, 1).Value <> "" Then Cells(i, 2).Value = "Hello"
Next
Application.ScreenUpdating = True
End Sub
[COLOR=#333333]Sub dispute()[/COLOR]
[COLOR=#333333] Range("M20").Value2 = "=IF(P20<>"""",""Hello123"","""")"[/COLOR]
[COLOR=#333333] Range("M20").AutoFill Range(Range("M20"), Range("A20").End(xlDown).Offset(0, [/COLOR][COLOR=#333333]12[/COLOR][COLOR=#333333]))[/COLOR]
[COLOR=#333333]End Sub[/COLOR]
This is what I have so far. Can I make it start in P15 and write "Hello123...." in M15 and so on......
Code:
Sub dispute()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "P").End(xlUp).Row
For i = 2 To Lastrow
If Cells(i, 1).Value <> "" Then Cells(i, 2).Value = "Hello123...."
Next
Application.ScreenUpdating = True
End Sub
Sub dispute()
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, [COLOR=#ff0000]16[/COLOR]).End(xlUp).Row 'this wont be reliable because the last cell of column P might be blank, use another column
For i = 2 To Lastrow
If Cells(i, 16).Value <> "" Then Cells(i, 13).Value = "Hello123...." 'reference column 16 or P to check if that is blank then edit column 13 cell... 13 = M
Next
Application.ScreenUpdating = True
End Sub