Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Hello,
I recorded a macro and have a small detail I need to fix, but am unsure how to do it. At the end of the recording of the macro, I hit the right arrow 3 times to move over 3 cells across. The problem is that the macro recorded it as follows: Range("F834").Select How do I change that line from an absolute reference to a relative one so that the cell I am on is 3 to the right? Thanks, Ben |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Try replacing this:
Range("F834").Select With this: ActiveCell.Offset(0, 3).Select Whatever cell you're in when the macro runs will determine where you end up. If you're in A1 you'll end up in D1. -- Biff Microsoft Excel MVP "ben" wrote in message ... Hello, I recorded a macro and have a small detail I need to fix, but am unsure how to do it. At the end of the recording of the macro, I hit the right arrow 3 times to move over 3 cells across. The problem is that the macro recorded it as follows: Range("F834").Select How do I change that line from an absolute reference to a relative one so that the cell I am on is 3 to the right? Thanks, Ben |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
As always, post your code for comments. It's almost always NOT necessary to
select a cell. -- Don Guillett Microsoft MVP Excel SalesAid Software "ben" wrote in message ... Hello, I recorded a macro and have a small detail I need to fix, but am unsure how to do it. At the end of the recording of the macro, I hit the right arrow 3 times to move over 3 cells across. The problem is that the macro recorded it as follows: Range("F834").Select How do I change that line from an absolute reference to a relative one so that the cell I am on is 3 to the right? Thanks, Ben |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Don Guillett wrote:
As always, post your code for comments. It's almost always NOT necessary to select a cell. I don't know what you mean since this would depend on what the user (me) wants to do. After highlighting the data in one excel file, I do a special paste with just the values of the highlighted region in another sheet (in another file) where the cell it finishes up on is 3 to the right of the paste so I can manually enter into that column data. I wanted this done through a macro, so I recorded one which worked fine except for which cell it ended up on which was not 3 to the right but ended up on the cell I ended with when recording the macro. |
#6
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
No problem. I'll certainly do that in the future.
Don Guillett wrote: Then Biff gave you a solution. You could have also used OFFSET. I repeat that you should always post your code for comments and improvement suggestions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro lookup columns | Excel Discussion (Misc queries) | |||
Need a macro to hide certain columns | Excel Discussion (Misc queries) | |||
insert columns macro is putting 2 columns instead of 1 | Excel Worksheet Functions | |||
macro to unmerge columns | Excel Discussion (Misc queries) | |||
Macro for resizing of columns? | Excel Discussion (Misc queries) |