- Aug 9, 2000
- 18,378
- 1
- 0
I am not getting why this won't work. I keep getting an error saying that teh object does not support the method.
Sub THD()
a = 0
i = 3
r = "Results"
'iterate through sheets
'Do Until Sheets(i).Value = Sheets(i).r
Do Until Sheets(i).Value = "Results"<--------------------this causes errors, does it want an actual value? How do i make this dynamic?
Sheets(i).Select
'Select the range to copy in sheet
Range("C52:C56", "C63:C67").Select
Selection.Copy
'Activate Result sheet
Sheets(r).Select
'pick empty cell to paste results into
If Cells(a, 1).Value = "" Then
a = a + 1
ActiveCell.PasteSpecial
'if cell is not empty, iterate to next cell
Else
a = a + 1
Cells(a, 1).Select
ActiveCell.PasteSpecial
End If
'iterate to next sheet
i = i + 1
Loop
Sub THD()
a = 0
i = 3
r = "Results"
'iterate through sheets
'Do Until Sheets(i).Value = Sheets(i).r
Do Until Sheets(i).Value = "Results"<--------------------this causes errors, does it want an actual value? How do i make this dynamic?
Sheets(i).Select
'Select the range to copy in sheet
Range("C52:C56", "C63:C67").Select
Selection.Copy
'Activate Result sheet
Sheets(r).Select
'pick empty cell to paste results into
If Cells(a, 1).Value = "" Then
a = a + 1
ActiveCell.PasteSpecial
'if cell is not empty, iterate to next cell
Else
a = a + 1
Cells(a, 1).Select
ActiveCell.PasteSpecial
End If
'iterate to next sheet
i = i + 1
Loop