Copying the first four columns data

Closed
Ran - May 6, 2009 at 10:34 AM
mubashir aziz Posts 190 Registration date Sunday April 12, 2009 Status Member Last seen February 16, 2010 - May 8, 2009 at 02:19 AM
Hello,
I want to copy the first 4 column of data from one sheet to another sheet in the same excel.
Basically the first 4 columns of data in sheet1 makes the key field and I do not want the manual insertion of data to be done in sheet2 and sheet3 in the same excell.The manual process of entering data is prone to error.

Please let me know how this can be done with macro.

The first 4 column of data has to go in the first 4 columns of sheet2 and sheet3.Hope I am clear,thanks

3 responses

mubashir aziz Posts 190 Registration date Sunday April 12, 2009 Status Member Last seen February 16, 2010 165
May 7, 2009 at 02:29 AM
You can linked the Data in Sheet2 & Sheet3 so whenever you'll make any change in Sheet1 your Sheet2 & 3 will be automatically changed ....

in sheet2 CellA1

A1=Sheet1!A2 then drag it down and left upto 4 columns ......

Do let me know if it helps you

Else if on the basis of these four column of first sheet you want to extract some column then you must use index/match or vlookup ........

0
Thanks for the response,I already tried out this method probably its my fault I didnt told what I have tried out already.
a)I have tried the transpose option also.

I do not want this drag drop or any dummy value in the first 4 columns as this sheet data will be uploaded to other system in the subsequent stages.
Hence I do no want any dummy value and I know the the backend processing which I think can be done u using the macros.
Hope I am clear,if not plz get back,thanks once again....
0
mubashir aziz Posts 190 Registration date Sunday April 12, 2009 Status Member Last seen February 16, 2010 165
May 8, 2009 at 02:19 AM
Try this


Sub Copy_Four()
'
' Macro to copy first 4 colum of sheet1 to sheet 2 & 3

'
Sheets("Sheet1").Activate
Columns("A:D").Select
Selection.Copy
Sheets(Array("Sheet2", "Sheet3")).Select
Sheets("Sheet2").Activate
Columns("A:A").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Application.CutCopyMode = False
Range("F21").Select


End Sub



0