Hi.
I have a book with multiple sheets, 6 are dumps of source data and 50 are worksheets I want to populate from the source.
I have a control sheet and in column c are the 50 worksheets and column d contains the related source sheet name.
I have the following code (kindly suggested here) to clear old info from the worksheets
Sub Lidget()
Dim Cl As Range
Dim UsdRws As Long
With Sheets("Control")
For Each Cl In .Range("C4", .Range("C" & Rows.Count).End(xlUp))
If Cl.Value <> "" Then
If Evaluate("isref('" & Cl.Value & "'!A1)") Then
Sheets(Cl.Value).Range("A1:F10").clearcontents
End If
End If
Next Cl
End With
End Sub
Now I'm trying to repeat this but with
Sheets(Cl.offset(0, 1).Value).Range("A1:F10").Copy
Sheets(Cl.Value).Range("A1:F10").paste
But I'm getting "object doesn't support this property or method"
I've tried making the offset of c1 a variable but I'm even worse with variables
I have a book with multiple sheets, 6 are dumps of source data and 50 are worksheets I want to populate from the source.
I have a control sheet and in column c are the 50 worksheets and column d contains the related source sheet name.
I have the following code (kindly suggested here) to clear old info from the worksheets
Sub Lidget()
Dim Cl As Range
Dim UsdRws As Long
With Sheets("Control")
For Each Cl In .Range("C4", .Range("C" & Rows.Count).End(xlUp))
If Cl.Value <> "" Then
If Evaluate("isref('" & Cl.Value & "'!A1)") Then
Sheets(Cl.Value).Range("A1:F10").clearcontents
End If
End If
Next Cl
End With
End Sub
Now I'm trying to repeat this but with
Sheets(Cl.offset(0, 1).Value).Range("A1:F10").Copy
Sheets(Cl.Value).Range("A1:F10").paste
But I'm getting "object doesn't support this property or method"
I've tried making the offset of c1 a variable but I'm even worse with variables