excel course tate modern - macro to change column

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » excel course tate modern - Macro To Change Column

excel course tate modern - Macro To Change Column

resolvedResolved · Low Priority · Version Standard

Mekanto has attended:
No courses

Macro To Change Column

I need a macro the change the column selected with a cell reference. For example C3 to E3, Without changing the row.

For some reason macro's will not record when I press the arrow keys.
Thanks,
Mekanto

RE: Macro To Change Column

Hi Mekanto

The macro recorder only records the arrow movement if the Relative Reference button on the [Stop Recording[/b] toolbar is clicked.

Once its done if you move from C3 to E3, using the arrow, it will record the following code:

ActiveCell.Offset(0, 2).Range("A1").Select

NB This moves the cursor 2 columns to the right irrespective of the start point

If you require the cursor to always go to E3 then:

1. Record the macro without the Relative Reference button being selected

2. Select E3

The code is recorded as

Range("E3").Select

Hope this helps

Carlos

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Printing spreadsheets without opening them first

Here's a fast way of printing a spreadsheet from Windows Explorer/My Computer.

Go to the location where the spreadsheet is saved on your computer, then right-click on the icon next to the document and select Print from the menu.

The spreadsheet will automatically open, print and close itself.

View all Excel hints and tips


Server loaded in 0.08 secs.