Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to add a new column with the previous column formula?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Based on data in previous column - sum of values in next column Beena K Excel Worksheet Functions 1 April 7th 09 07:23 PM
Shortcut to select column with data in previous column TJAC Excel Discussion (Misc queries) 1 July 10th 07 06:12 PM
vlookup value from previous column simonc Excel Discussion (Misc queries) 1 April 26th 07 10:34 AM
How to add previous sums in a column to current sums in a column? TD Excel Worksheet Functions 1 September 30th 06 02:55 PM
Previous Column Terry VanDuzee Excel Programming 1 July 31st 03 05:18 PM


All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"