Hi all,
I feel like I'm so close to get this done but I can't figure out how to do the last step.
Long story short, I'm writing a code to delete data in some tabs.
I want the code to look in my mapping tab and then for each cell until the cell is empty to go to the related tab and delete data.
the part I'm struggling with is the one below in red. I can't figure how to use A3 string data the 1st time the loop runs, then A4, then A5 etc.
I've looked online and in the forum but didn't find anything so hopefully you will be able to help
Many thanks for your help!
Sub Erase_data()
Sheets("Mapping").Select
Range("I3").Select
Dim x As Integer
numrows = Range("I3", Range("I3").End(xlDown)).Rows.Count
For x = 1 To numrows
Dim Name As String
Name = Sheets("Mapping").Range("I2"+x).Value
Sheets(Name).Select
Range("A3:F100").Select
Selection.ClearContents
Range("A1").Select
ActiveCell.Offset(1, 0).Select
Next
End Sub
Bookmarks