View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to add a new column with the previous column formula?

Sean,

Here is some code

Dim cLastCol As Long

cLastCol = Cells(1, Columns.Count).End(xlToLeft).Column
Cells(1, cLastCol).EntireColumn.Copy Destination:=Cells(1, cLastCol + 1)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"arshia22" wrote in message
ups.com...
Hi everybody;
How can I write a macro to add a new column to the right of the last
column of my sheet , in a way that it also copy all the formulas from
the previous column?
regards,
Sean