DreamWeaver1108
New Member
- Joined
- Apr 27, 2018
- Messages
- 3
Below is my VBA that I am using and it is telling me that the line in red is the error. I understand that it is trying to select a cell on the Summary tab of my workbook and then delete the data sot hat is can come back with new data to paste in its place. We have been running this for months and this month it kicked me out an error and I cannot seem to get past it.
Sub MHPaste()
Worksheets("MH Data").Visible = True
Worksheets("MH Data").Activate
'Worksheets("MH Data").Range("S2").Copy
'Worksheets("MH Data").Range("AE12").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Worksheets("MH Data").Visible = False
Worksheets("Summary").Range("A10").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete
Dim mhslt
mhslt = Worksheets("MH Data").Range("AA10")
Worksheets("MH Data").Range(mhslt).Copy
Worksheets("Summary").Range("A9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Any assistance would be greatly appreciated.
Thank you.
Scott
Sub MHPaste()
Worksheets("MH Data").Visible = True
Worksheets("MH Data").Activate
'Worksheets("MH Data").Range("S2").Copy
'Worksheets("MH Data").Range("AE12").Select
'Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Worksheets("MH Data").Visible = False
Worksheets("Summary").Range("A10").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete
Dim mhslt
mhslt = Worksheets("MH Data").Range("AA10")
Worksheets("MH Data").Range(mhslt).Copy
Worksheets("Summary").Range("A9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Any assistance would be greatly appreciated.
Thank you.
Scott