Seamus2626
asked on
Sub error
Hi,
When i run the below code i get the error
"Object Variable or with Variable not set"
Does anyone know how to resolve this?
Thanks
Seamus
When i run the below code i get the error
"Object Variable or with Variable not set"
Does anyone know how to resolve this?
Thanks
Seamus
Sub SumUpForTable2()
Dim FoundCell As Range
Sheets("Corporate Actions").Select
Range("B3").Select
Do Until ActiveCell.Value = ""
mysheetname = ActiveCell.Text
Sheets(mysheetname).Select
If Range("A2").Value = "" Then
Sheets("Corporate Actions").Select
ActiveCell.Offset(0, 1).Value = "0"
ActiveCell.Offset(0, 2).Value = "0"
ActiveCell.Offset(1, 0).Select
Else
FoundCell = Columns("C:C").Find(What:="Grand Total", LookIn:=xlValues, _
lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
End If
With FoundCell
.Offset(0, 7).Select
ActiveCell.Resize(1, 2).Select
Selection.Copy
Sheets("Corporate Actions").Select
ActiveCell.Offset(0, 1).PasteSpecial Paste:=xlPasteValues
End With
Loop
Range("C3:C23").Select
Selection.NumberFormat = "#,##0"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Thanks Kyle
Seamus
Seamus
You're welcome. I've only done that about a million times. :)
Kyle
Kyle
ASKER
FoundCell = Columns("C:C").Find(What:=
lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)