PDA

View Full Version : [SOLVED] Simplify and automate



Phprahl
03-23-2005, 02:37 AM
Hi,

I wonder if the code below can be changed so I dont need to run the macro every time? What I want is that every time i make a sheet active I want a specific cell to be active even if i leave the sheet when another cell is active.

I have solved it by a macro that runs when the sheet is activated, but I wonder if it can be done without a macro?

Here is the code:


Private Sub Worksheet_Activate()
Call RememberActive
End Sub

Sub RememberActive()
Dim r As Long, c As Integer
Sheets(3).Activate
Range("F12").Select
r = ActiveCell.Row
c = ActiveCell.Column
End Sub


Rgds
/Phprahl

Killian
03-23-2005, 02:57 AM
Hi,

I don't think there is a way of doing this without code but thats what the code (and especially a workbook/sheet event) is for. The following line in the activate event for the sheet (rather than the workbook), activates a specified cell


Range("F12").Activate

Regouin
03-23-2005, 03:00 AM
What exactly do you want to do with the row and column afterwards?

Phprahl
03-23-2005, 03:13 AM
How simple....Exactly what I wanted, Killian!

Thanks! :bow: