Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop & Cell Reference


I am sure this will be easy for the experts.

I have 500 rows of data and each one seperately has to be copied to
seperate row for calculations to occur.

More specifically I want the 1st row, 5 columns, to be moved to th
other cells for calculations and then it moves, loops, to the next ro
which are moved to the cells for calculations, and so on 498 mor
times.

Any suggestions?

Thank

--
bforster
-----------------------------------------------------------------------
bforster1's Profile: http://www.excelforum.com/member.php...fo&userid=1177
View this thread: http://www.excelforum.com/showthread.php?threadid=55711

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Loop & Cell Reference

Get the code to do the copying with the macro recorder.
Bear in mind you can define a range with variables like this:
Dim i As Long
Range(Cells(i, 1), Cells(i, 5))
Look in the VBA help at the For Next loop.
Combine the three.

RBS

"bforster1" wrote
in message ...

I am sure this will be easy for the experts.

I have 500 rows of data and each one seperately has to be copied to a
seperate row for calculations to occur.

More specifically I want the 1st row, 5 columns, to be moved to the
other cells for calculations and then it moves, loops, to the next row
which are moved to the cells for calculations, and so on 498 more
times.

Any suggestions?

Thanks


--
bforster1
------------------------------------------------------------------------
bforster1's Profile:
http://www.excelforum.com/member.php...o&userid=11771
View this thread: http://www.excelforum.com/showthread...hreadid=557112


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Loop & Cell Reference

This little macro does all the copying and looping but it doesn't do any
calsculations. Did you want the macro to do any calculations? This macro
loops through all the occupied rows in Column A and copies each 5 column row
to B600 in turn. HTH Otto
Sub LoopCopy()
Dim RngColA As Range
Dim i As Range
Set RngColA = Range("A1", Range("A" & Rows.Count).End(xlUp))
For Each i In RngColA
i.Resize(, 5).Copy Range("B600")
Next i
End Sub
"bforster1" wrote
in message ...

I am sure this will be easy for the experts.

I have 500 rows of data and each one seperately has to be copied to a
seperate row for calculations to occur.

More specifically I want the 1st row, 5 columns, to be moved to the
other cells for calculations and then it moves, loops, to the next row
which are moved to the cells for calculations, and so on 498 more
times.

Any suggestions?

Thanks


--
bforster1
------------------------------------------------------------------------
bforster1's Profile:
http://www.excelforum.com/member.php...o&userid=11771
View this thread: http://www.excelforum.com/showthread...hreadid=557112



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
How to loop by chaning the cell reference? [email protected] Excel Programming 4 October 7th 05 09:17 AM
reference 2 arrays in a For Loop Bruce Excel Programming 1 June 10th 05 08:45 AM
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. [email protected] Excel Worksheet Functions 2 December 11th 04 12:05 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM
Excel VBA Loop & Variable Reference Carolyn[_4_] Excel Programming 2 October 15th 04 08:30 PM


All times are GMT +1. The time now is 12:08 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"