Modify macro copy and paste data from multiple rows

aamarb

New Member
Joined
Nov 8, 2010
Messages
13
Hi Guys,

I currently have a macro that copies a single row of raw data from the clipboard into PasteSpecial sheet, Email Extract sheet then reorders/formats the data which then copies the reordered data into the DataChecker sheet.

the number of rows in the raw data has increased exponentially, is there any way the current macro could be modified so multiple rows can be done at once. please see the code below:

Sub DATM()
'
' DATM Macro
'
' Keyboard Shortcut: Ctrl+d
'
Range("A2").Select
ActiveSheet.PasteSpecial
Sheets("Email Extract").Select
Range("Table1").Select
Selection.Copy
Sheets("Data Checker").Select
Cells(Range("A1000000").End(xlUp).Row + 1, 1).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("Paste MailTable").Select
Range("A4").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Record updated"
End Sub

Many thanks in advance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try yo change to
Code:
Range("table1").CurrentRegion.Select
 
Upvote 0
Check this
you can hit F8
Code:
Sub Test()Range("table1").CurrentRegion.Select
Selection.Copy
Sheets("sheet2").Activate
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub
 
Upvote 0
Please supply the cross post link.
Thanks
 
Upvote 0
Check this
you can hit F8
Code:
Sub Test()Range("table1").CurrentRegion.Select
Selection.Copy
Sheets("sheet2").Activate
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub

Thanks for that but that does not work for what i need. I have attached a sample spreadsheet to clarify the issue
 
Upvote 0
HI
have you named named rang as table1?
Other wise it is working here
 
Upvote 0
Sub Test()
Code:
Range("table1").CurrentRegion.Select
Selection.Copy
Sheets("sheet2").Activate
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub
make sure the name table1 or what ever
 
Last edited:
Upvote 0
Code:
Sub Test()
Range("table1").CurrentRegion.Select
Selection.Copy
Sheets("sheet2").Activate
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub
make sure the name table1 or what ever spelling
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,142
Members
448,551
Latest member
Sienna de Souza

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