ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Looking for another way (https://www.excelbanter.com/excel-worksheet-functions/63803-looking-another-way.html)

tim

Looking for another way
 

I am trying to find a solution for an earlier post. Is there a way for a
macro to copy only the selected cells on multiple sheets and paste onto
a sheet. I want to copy let's say A1:A7 - B1:B7 from about four sheets.
I will have already made the selection I just want the macro to copy the
selections from the four different sheet and patse it on a fifth sheet.


--
tim

R.VENKATARAMAN

Looking for another way
 
try this sub and see whether you get what you want
may benot elegant.

Public Sub test()
Dim dest As Range
Dim shcount As Worksheet
Set shcount = Worksheets(Sheets.Count)
Dim n As Integer
n = Sheets.Count - 1
Dim i As Integer
For i = 1 To n
Worksheets("sheet" & i).Activate
Set dest = shcount.Cells(65536, 1).End(xlUp).Offset(1, 0)
Range(Range("a1"), Range("B77")).Copy Destination:=dest
Next i
shcount.Rows("1:1").Delete
shcount.Activate
End Sub


"tim" wrote in message
...

I am trying to find a solution for an earlier post. Is there a way for a
macro to copy only the selected cells on multiple sheets and paste onto
a sheet. I want to copy let's say A1:A7 - B1:B7 from about four sheets.
I will have already made the selection I just want the macro to copy the
selections from the four different sheet and patse it on a fifth sheet.


--
tim





All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com