next cell in a macro

G

Guest

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?
 
G

Guest

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.
 
J

Jim Rech

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

--
Jim
| 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?
|
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top