LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Shift constant values in a range left or right by n columns

Hi, Excel folks -

Given a range containing some cells with constant values and some cells with
formulas, what is the most efficient way to shift only the constant values
left or right by a specified number of columns, leaving formulas and all
formatting in source and target cells unchanged? I'd also want to clear the
values in the cells from which the data has been moved.

What this is all about is a worksheet that contains columns representing
months of data, with the rows representing line items or various subtotals.
I want to advance or retreat the date window by a user-specified number of
months.

I've worked out how to do this by looping through the rows and columns of
the range, but (a) the code is slow, taking about several seconds to
execute, and (b) it seems to me this is not the "Excel" way to do this. I
feel like there ought to be a set of simple range operations to accomplish
it.

Can you advise me, please?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
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
Shift cells to the left Steve D.[_2_] Excel Programming 4 July 9th 07 01:26 AM
Searching a date range to output values according to a constant. Geebz Excel Discussion (Misc queries) 2 December 1st 06 09:34 AM
Searching a date range to output values according to a constant. daddylonglegs Excel Discussion (Misc queries) 0 November 30th 06 08:23 PM
Assign a 2D array of constant values to a range dodgo Excel Programming 4 October 19th 06 04:46 AM
Shift data to left Steph[_3_] Excel Programming 4 April 13th 05 03:58 AM


All times are GMT +1. The time now is 11:46 AM.

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

About Us

"It's about Microsoft Excel"