I said: "I'm not sure what you're trying to accomplish" I guess what I should have said was: "I'm not sure of the PURPOSE of your code"
You said: "run that code on each column (a through j)" from what I can tell... your code starts in whatever cell is currently selected, It first puts a (1) in the cell immediately above the current cell. then, it checks to see if the currently selected cell is empty. If it's not, then it changes the value by adding (1) to the current value and multiplying it by the value of the cell immediately above it. Then, it moves to the next cell DOWN and keeps going until the last row. (which you must mean to move to the right, which would be: Activecell.offset(0,1).select) this macro does not process columns a-j, it processes any cell beginning from the current cell until the end of the spreadsheet.. depending on the use of the Activecell.offset(0,1).select or Activecell.Offset(1,0).select and the version of excel, it could be excel 2003: 65,536 rows or 256 columns, or excel 2007: or 1,048,576 rows or 16,384 columns so... hopefully, the .Offset(0,1) fixes the direction problem. but you definitely ought to consider selecting the starting and ending points... Paul ________________________________ From: JsinSk <jsin...@gmail.com> To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> Sent: Wed, April 14, 2010 8:04:40 AM Subject: Re: $$Excel-Macros$$ Move from column a to b to c in loop Basically, I want to run that code on each column (a through j). One column at a time. On Apr 14, 7:38 am, Paul Schreiner <schreiner_p...@att.net> wrote: > I'm not sure what you're trying to accomplish, but.... > > First of all, I believe the format of .Offset is .Offset(row,column) > which means activecell.offset(1,0).select moves down one ROW > not to the right one COLUMN > > Paul > > ________________________________ > From: JsinSk <jsin...@gmail.com> > To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> > Sent: Tue, April 13, 2010 11:18:08 PM > Subject: $$Excel-Macros$$ Move from column a to b to c in loop > > Hello again friends, I am cannot figure out how to make this work the > way I want :( > > I need this to run in column a, then b, then c... but cannot figure > out how to do it. Can someone please help with this matter. I'm sure > it's a very simple solution! > > Sub Macro1() > > ActiveCell.Offset(-1, 0) = 1 > Do While Not IsEmpty(ActiveCell.Value) > > ActiveCell.Value = (ActiveCell.Value + 1) * ActiveCell.Offset(-1, > 0).Value > ActiveCell.Offset(1, 0).Select > Loop > > End Sub > > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links > :http://twitter.com/exceldailytip > 2. Join our Facebook Group @http://www.facebook.com/group.php?gid=287779555678 > 3. Excel tutorials athttp://www.excel-macros.blogspot.com > 4. Learn VBA Macros athttp://www.quickvba.blogspot.com > 5. Excel Tips and Tricks athttp://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > HELP US GROW !! > > We reach over 6,800 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 athttp://groups.google.com/group/excel-macros/subscribe > > To unsubscribe, reply using "remove me" as the subject. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 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 <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 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 -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 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 <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 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