Hi Jason,

One way to increment your cell is to use the "Cells" thingy.

The "Cells" thingy uses Row, then Column within it's brackets, and it uses 
numbers for both - not letters for Columns.

So, Cells(1, 3) refers to Row 1, Column 3, which is the same as Range("C3")

But with the cells thingy, you can use a variable.

So:

 

MyRow=15

Cells(MyRow, 1)

 

This refers to Row 15, Column A, and is the equivalent to Range("A15")

 

So you can use this sort of code:

 

For i = 2 to 20

(Your Copy and Paste code lines go here, using Cells(i, 1) as the paste 
destination)

Next i

 

The "For i" code line sets the number of times the code will loop. Change this 
to your requirements. Make the first number (in this example, 2) equal the your 
first Row number. You can then use i as the variable in the Cells thingy. 
Making the first number 2, and the last number 20, means that the code will be 
repaeted 19 times.

 

The "Cells(i, 1)" uses the fact that the value i for starts at 2, and is 
incremented every loop.

The first time, Cells(i, 1) will refer to A2. The next time through the loop, i 
will be 3, so Cells(i, 1) will refer to A3, and so on.

 

Hope this helps.

Regards - Dave.

 

 

 

 

 
> Date: Sun, 7 Feb 2010 13:54:22 -0800
> From: opie...@yahoo.com
> Subject: $$Excel-Macros$$ excel vba help
> To: excel-macros@googlegroups.com
> 
> I am trying to teach myself how to use the vba. I want to use a copy/paste 
> and loop macro for some equations. I already know how to use my formulas to 
> automatically calculate but I need help getting info into the right cell. The 
> basics of it goes like this; I want to get a number to copy to the x cell and 
> then copy the next number to the x cell.
> 1 x
> 2
> 3
> 4
> 5
> etc.
> I have been looking online for three days and all of the examples that I find 
> do not run for one reason or another. Any plain SIMPLE explanations and 
> examples would help greatly. Thanks
> 
> 
> 
> 
> 
> -- 
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links : 
> http://twitter.com/exceldailytip
> 2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
> http://www.excelitems.com
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
> 
> 
> To post to this group, send email to excel-macros@googlegroups.com
> If you find any spam message in the group, please send an email to:
> Ayush Jain @ jainayus...@gmail.com
> <><><><><><><><><><><><><><><><><><><><><><>
> HELP US GROW !!
> 
> We reach over 6,700 subscribers worldwide and receive many nice notes about 
> the learning and support from the group.Let friends and co-workers know they 
> can subscribe to group at 
> http://groups.google.com/group/excel-macros/subscribe
                                          
_________________________________________________________________
Video chat with Windows Live Messenger Learn how
http://windowslive.ninemsn.com.au/messenger/article/870686/video-chat-with-messenger

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to