Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am writing a procedure where i am standing in a cell.
Thereafter i shall automatically in the prosedure change the width of column D-E from 20 to 40. Afterwards i want the same cell to be active as it was before i started the procedure. I am using relative reference in the procedure. Can someone please help me with how i save an cell adrress for reuse later? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So, if I understand you code, you want to call a sub routine that takes care
of the column width piece then when it pops back to where you called the procedure, you would like it to go back to the cell you started on. If that's the case, simply do one one of the following: (A) Create a string variable in the calling procedure and pass it the address of the activecell. (B) Create a Range variable and in the calling procedure pass it the activecell. Following your procedure call use the RANGE command to select your variable's range. "loco" wrote: I am writing a procedure where i am standing in a cell. Thereafter i shall automatically in the prosedure change the width of column D-E from 20 to 40. Afterwards i want the same cell to be active as it was before i started the procedure. I am using relative reference in the procedure. Can someone please help me with how i save an cell adrress for reuse later? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You do NOT have to goto columns d:e to set the column width
Sub widencolumn() Columns("d:e").ColumnWidth = 40 End Sub But, to answer your question Sub goback() returncell = ActiveCell.Address Range("a33").Select MsgBox ActiveCell.Address Range(returncell).Select End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "loco" wrote in message ... I am writing a procedure where i am standing in a cell. Thereafter i shall automatically in the prosedure change the width of column D-E from 20 to 40. Afterwards i want the same cell to be active as it was before i started the procedure. I am using relative reference in the procedure. Can someone please help me with how i save an cell adrress for reuse later? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much.
I could copy your code suggestion directly into my VB-code and it did run OK at once. Loco Don Guillett skrev: You do NOT have to goto columns d:e to set the column width Sub widencolumn() Columns("d:e").ColumnWidth = 40 End Sub But, to answer your question Sub goback() returncell = ActiveCell.Address Range("a33").Select MsgBox ActiveCell.Address Range(returncell).Select End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "loco" wrote in message ... I am writing a procedure where i am standing in a cell. Thereafter i shall automatically in the prosedure change the width of column D-E from 20 to 40. Afterwards i want the same cell to be active as it was before i started the procedure. I am using relative reference in the procedure. Can someone please help me with how i save an cell adrress for reuse later? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Event Procedure (re-activate automatic calulation if disabled) | Excel Programming | |||
Error 1004 from worksheet activate procedure | Excel Programming | |||
selection.find shortening the procedure by skipping the "activate" part | Excel Programming | |||
How to Activate procedure with parameters | Excel Programming |