Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formulas over alternate columns

Status
Not open for further replies.

slames

Technical User
Nov 5, 2002
211
GB
I currently have an excel spreadsheet with vba formulas. These formulas currently cover a range of one column, I want to try and make it so the formula covers a number of alternate columns rather than one long column, to avoid the need to scroll down 1000 rows.
Any Ideas?
Steph
 
if nrows is the number of rows in your current column, and rowspercol the desired number of rows in each new column:

ic=2
do while ic<=(nrows-1)\rowspercol+1
range(cells((ic-1)*rowspercol+1,1),cells(ic*rowspercol,1)).copy range(cells(1,ic*2-1),cells(rowspercol,ic*2-1))
ic=ic+1
loop
range(cells(rowspercol+1,1),cells(nrows,1)).clear

Rob
[flowerface]
 
the code above assumes your current formulas are in column A, and you want them in columns A,C,E,...
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top