First time posting on this website. I request some much needed help with a small project I am working with.
I need to remove all negative numbers past a certain cell which is determined by today's date. To give some background, Cell G3 is a formula that uses an HLOOKUP to determine the column of data that corresponds with today's date. I need to delete all negative numbers to the right of that column (which are future dates) and are also below row 9. The VBA code below is not working and I would greatly appreciate some assistance from you guys. I do not use VBA often and this is one of my first projects in it.
2 Edits in Bold Question: I would like to delete negative numbers from rows succeeding row 9 and columns succeeding the column number in Cell G3
The Code does not work - meaning that the code does not result in any errors or anything, it simply runs but does not delete negative numbers succeeding row 9 and the column number within Cell G3
Below is what I have so far:
Sub Negative_to_Zero()
Dim RowNum As Long, ColNum As Long, H3 As Integer
H3 = Range("G3").Value
Application.ScreenUpdating = False
For ColNum = H3 To Cells(1, Columns.Count).End(xlToLeft).Column
For RowNum = 9 To Cells(Rows.Count, ColNum).End(xlUp).Row
If Cells(RowNum, ColNum) < 0 Then Cells(RowNum, ColNum) = 0
Next RowNum
Next ColNum
Application.ScreenUpdating = True
End Sub
H3instead ofH3 + 1(and similarly9instead of9 + 1)?