Copy the cells (with fomat, farmula etc) using VB Code

Copy the cells (with fomat, farmula etc) using...

Didn't find your answer?

I used following code. However, it copied only the values from one sheet to other:

for i = 1 to 10
for j = 1 to 10
Worksheets("Test1").Cells(i, j) = Worksheets("Test2").Cells(i, j)
next i
next j

Can anyone suggest the VB code so that columns copied frm one sheet to other looks identical.

Thanks,
Amit
Amit Bhatnagar

Replies (2)

Please login or register to join the discussion.

avatar
By AnonymousUser
14th Nov 2002 16:41

Thanks Bob
It was very simple... Thanks for your guidance.

Regards,
Amit

Thanks (0)
avatar
By AnonymousUser
14th Nov 2002 13:46

Just record it
The easiest way is simply to record a macro that formats a column in the way you want it and then paste the code that the recorder generates into your original macro.

Thanks (0)