#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default next cell in a macro

An excell spreadsheet works as a master log of forms completed over a period
of time.
A macro opens the master log, finds the next empty cell in a column and
copies a cell of information to the cell in the other workbook. This part
works fine.
It then needs to go to the next cell on the left and copy an additional
information from the form workbook. When I use the "record a macro" it
inserts the absolute cell name (say G2) rather than a relative address (i.e.,
move one cell to the left). What statement should I use?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default next cell in a macro

Assuming you are using the active cell then

ActiveCell.Offset(0, -1).Select

FYI when you ask a code question post your code or at least a snippet so
that we can see what you are up to. It makes answering a lot easier and more
precise.
--
HTH...

Jim Thomlinson


"Pa Maher" wrote:

An excell spreadsheet works as a master log of forms completed over a period
of time.
A macro opens the master log, finds the next empty cell in a column and
copies a cell of information to the cell in the other workbook. This part
works fine.
It then needs to go to the next cell on the left and copy an additional
information from the form workbook. When I use the "record a macro" it
inserts the absolute cell name (say G2) rather than a relative address (i.e.,
move one cell to the left). What statement should I use?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default next cell in a macro

The 'cell to the left' of the active cell is referred to as
ActiveCell.Offset(0,-1) programmatically.

--
Jim
"Pa Maher" wrote in message
...
| An excell spreadsheet works as a master log of forms completed over a
period
| of time.
| A macro opens the master log, finds the next empty cell in a column and
| copies a cell of information to the cell in the other workbook. This part
| works fine.
| It then needs to go to the next cell on the left and copy an additional
| information from the form workbook. When I use the "record a macro" it
| inserts the absolute cell name (say G2) rather than a relative address
(i.e.,
| move one cell to the left). What statement should I use?
|


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default next cell in a macro

After you turn macro record on, right click on any toolbar and display the
STOP RECORDING toolbar. The second button (of 2 to choose from) toggles
Abslolue/Relative record. Set it to record relatively.
--
Kevin Backmann


"Pa Maher" wrote:

An excell spreadsheet works as a master log of forms completed over a period
of time.
A macro opens the master log, finds the next empty cell in a column and
copies a cell of information to the cell in the other workbook. This part
works fine.
It then needs to go to the next cell on the left and copy an additional
information from the form workbook. When I use the "record a macro" it
inserts the absolute cell name (say G2) rather than a relative address (i.e.,
move one cell to the left). What statement should I use?

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
macro to move part of cell contents to another cell icetoad hisself Excel Discussion (Misc queries) 4 November 27th 06 07:19 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Using macro to copy a part of a cell content to next cell Charles Excel Discussion (Misc queries) 6 May 31st 06 05:57 AM
Run Macro from a Cell Danny Excel Worksheet Functions 0 March 27th 06 05:51 PM
Macro for cell selection starting with Last Cell Valerie Excel Worksheet Functions 4 December 9th 05 08:25 PM


All times are GMT +1. The time now is 12:44 PM.

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"