Excel Macros

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I want to create a macro in Excel that pertain to the
current cell. For instance; I have several cell that
need to be sorted while others cells does not so I want
to highlight the cells to be sorted and hit a recorded
macro.

When I tried to create a macro by recording my actions,
it gives the cell reference of that cell, not of the
current cell if I went to another cell.

I need to know how to reference the current cell when I
highlight it to run the macro.
 
If you are recording a macro, then you want to use
the "Relative Reference" icon on the "Stop Recording"
toolbar that appears when you record a macro. The VBA
syntax for using the current cell can be "ActiveCell"
or "Selection".
 
Back
Top