Move columns of data from one worksheet to another in open WB

G

George

Good Day,

I have a open workbook with multiple worksheet tabs, on "Tab 9" I need to
move the entire contents of Column "A" to Column "A" of "Tab 2", Column "B"
to Column "D", etc...

Can someone help direct me with the VB code to perform this task.

Thanks You in advance
George
 
P

Paul Robinson

Hi
Can you expand on your etc a bit? If there is a pattern to what is
copied to where it can be done in a loop. If not, some other method
will be better.
The code should be easy either way, but I don't fancy having to solve
the problem twice!
regards
Paul
 
G

George

Hi Paul,

Thanks for your respose,

To expound, The data is monthly information that gets moved to a particular
worksheet tab and column location based on the month. An example is;

Worksheet Tab 9
Month of Data = April
Columns "A, B, C, D, E" Data needs to move to Woksheet Tab 1, Columns "A, B,
C, D, E"

For next month of data
Worksheet Tab 9
Month of Data = May
Columns "B, C, D, E" Data needs to move to Woksheet Tab 1, Columns "K, L, M,
N"

For next month of data
Worksheet Tab 9
Month of Data = June
Columns "B, C, D, E" Data needs to move to Woksheet Tab 1, Columns "T, U, V,
W"

I use Case statement to select the proper month and location and what i need
is the code that will move or copy the data in each of the Worksheet 9
columns.

Thanks
 
R

Ranjith Kurian

Hi

Active the sheet which ever you want to be copied to tab1 and run the below
macro.

Sub copy_tab()
Dim lastrow
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("sheet1").Select
lastrow = Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top