Windows 7 Forums


Windows 7: EXCEL VBA 2007 Macro: Offsetting cell form a user defined selection

12 Jul 2011   #1

Windows XP
PA
 
 
EXCEL VBA 2007 Macro: Offsetting cell form a user defined selection

Hello
I am writing a line of code as part of a more complex program that is not working correctly. I am new to VBA so please bear with me...

Essentially, I am prompting the user to select a cell which is then assigned to the variable 'celNm'.
I then perform the following actions:
celNm.EntireRow.Copy
celNm.EntireRow.Insert
Next, for reasons specific to the program (and I am assuming the celNm will be located at the same cell after the command [Not the same location]), I want to move the cell selection upwards, so it is now located at the row just recently copied above. I am using the following line to do this:
celNm.Offset(-1, 0).Select
This, however, does not work.
The next step in the program would be to create a list in this location. However the program still creates a list at the previous location (in the cell selected). Why is this?

My System SpecsSystem Spec

Reply

 EXCEL VBA 2007 Macro: Offsetting cell form a user defined selection problems?



Thread Tools



Similar help and support threads for: EXCEL VBA 2007 Macro: Offsetting cell form a user defined selection
Thread Forum
Excel Macro Microsoft Office
Excel 2010 Multiply cell Microsoft Office
Excel 2007 Home and Studentl: calculation results in blank cell Microsoft Office
Excel 2003 Macro Help? Microsoft Office
uac crashes excel macro Microsoft Office


All times are GMT -5. The time now is 02:55 PM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

Windows 7 Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32