Just a note, I am new to VBA
I have a number of columns. If any column has the header "X", I want it to clear rows 10 - 20 from that column. I know I have to create a function but I cannot figure out what the function is. The function and the loop are below for you to see.
Thanks for any assistance
Public Function ColumnLettersFromRange(rInput As Range) As String
ColumnLettersFromRange = Mid(ActiveCell.Address, 2, InStrRev(ActiveCell.Address, "$") - 2)
End Function
dim RowDelete
Set RowDelete = Range("A9:Z9")
For Each cell in RowDelete
if cell.value = "X" then (ColumnLettersFromRange & "10:" &
ColumnLettersFromRange & 20).clear
Next Cell
