Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2007, 06:16 AM
Zobags Zobags is offline
Member
 
Join Date: Oct 2006
Location: Wherever it is legal.
Posts: 93
Default Excel VBA Help

I am building a big spreadsheet in excel, and I was wondering if I could create a macro that moves the Active Cell one cell down and one cell to the right. Does anyone know if this is possible or how to do it? Any help would be greatly appreciated. Also, recommendations to any other forums where I might find the answer would be appreciated.
Reply With Quote
  #2  
Old 08-17-2007, 07:27 AM
kerowo kerowo is offline
Senior Member
 
Join Date: Nov 2005
Posts: 6,880
Default Re: Excel VBA Help

If you want all the other cells to move as well:
Record a macro
select a cell
insert a cell above it moving it down
insert a cell to the right of it moving the cells to the left
stop the macro

If you want to cut and paste overwriting the contents of the target but not moving other cells:
Record a macro
select a cell
cut
paste in target
stop the macro

You may have to edit the last macro to generalize the target cell from source cell, but it should just be a matter of taking the active cell and adding one to the row and column.
Reply With Quote
  #3  
Old 08-17-2007, 10:17 AM
nuclear500 nuclear500 is offline
Senior Member
 
Join Date: Aug 2004
Location: Madison, WI
Posts: 1,065
Default Re: Excel VBA Help

As the other poster said, learning how to create macros is as simple as just recording one and then looking at the code.

As someone who has done programmatic access (via vbscripts or apps) to Word and Excel I cannot tell you how easy it was to do fancy junk by just ganking the code after recording the macro.
Reply With Quote
  #4  
Old 08-17-2007, 04:20 PM
Zobags Zobags is offline
Member
 
Join Date: Oct 2006
Location: Wherever it is legal.
Posts: 93
Default Re: Excel VBA Help

I tried recording first, but it didn't work because it records the absolute position of the cell rather than the relative one. For example, if I start at A1 and move to B2 the recorded macro just says Range("B2").select. Someone on the software forum gave me the solution, but thank you anyway for your help.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.