Copy data from worksheet and paste in same worksheet but at different range

adpatel

New Member
Joined
May 30, 2019
Messages
42
Office Version
  1. 2016
Platform
  1. Windows
[COLOR=#BBC0C4 !important][COLOR=#6A737C !important]I have some data points that are unique in each sheet and the same unique data points need to pasted as a value in the same worksheet but at different range
[/COLOR]
[/COLOR]
I have write down following VBA code for copy paste in same sheet


<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Sub EOD()

Dim i As Long

For i = 4 To ThisWorkbook.Worksheets.Count

Range
("B11:G150").Select
Selection
.Copy
Range
("AA11").Select
Selection
.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range
("Q11:V150").Select
Application
.CutCopyMode = False
Selection
.Copy
Range
("AG11").Select
Selection
.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application
.CutCopyMode = False
Range
("AA13").Select

Next

End Sub</code>but this code copied data from sheet number 4 and pasted in other sheets
what I was trying in above code is, copy data from range "B11:G150" and paste it in same worksheet in cell "AA11" and further copy data from range "Q11:V150" and paste it in same worksheet in cell "AG11"
this loop should be start after sheet number 3(from sheet no.4) and run up to last sheet
kindly help with this. thnx

 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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