Method of Rand Class Failed

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
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Maybe this instead

Code:
With Worksheets("MH Data")
    .Range("S2").Copy
    .Range("AE12").PasteSpecial Paste:=xlPasteValues
End With

With Worksheets("Summary")
    .Activate
    .Range(Range("A10").End(xlToRight), Range("A10").End(xlDown)).Delete
End With
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top