Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default macro help please

I wish to write a macro which, when run, will return to the active (has
focus) cell.
Is this achievable?
--
tia

Jock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default macro help please

Sub whereisactive()
MsgBox (ActiveCell.Address)
End Sub

--
Gary''s Student - gsnu200718


"Jock" wrote:

I wish to write a macro which, when run, will return to the active (has
focus) cell.
Is this achievable?
--
tia

Jock

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default macro help please

That tells me which is the active cell, however, I want it to be visible when
the macro is run. :)
--
tia

Jock


"Gary''s Student" wrote:

Sub whereisactive()
MsgBox (ActiveCell.Address)
End Sub

--
Gary''s Student - gsnu200718


"Jock" wrote:

I wish to write a macro which, when run, will return to the active (has
focus) cell.
Is this achievable?
--
tia

Jock

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default macro help please

O.K. If you want the Activecell address displayed in a cell, then:

Sub whereisactive()
Range("A1").Value = ActiveCell.Address
End Sub
--
Gary''s Student - gsnu200718
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default macro help please

Apologies if I was being unclear.
At top of worksheet (in cell I3), I have a button with macro which, when
clicked goes to AA15 (for instance).
As time goes on, the user could be on row 2000, but can still access the
button at the top taking him to AA15. I would like the button (and macro)
next to AA15 to take the user back to wherever he has just come from ie
A2000. Is this possible?
--
tia

Jock


"Gary''s Student" wrote:

O.K. If you want the Activecell address displayed in a cell, then:

Sub whereisactive()
Range("A1").Value = ActiveCell.Address
End Sub
--
Gary''s Student - gsnu200718



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default macro help please

Jock,

try something like this


Sub Button1_Click()
Dim rStartCell As Range

'Remember the current active cell
Set rStartCell = ActiveCell

'YOUR CODE HERE

'Check if we have moved to a different sheet
If ActiveSheet.Name < rStartCell.Parent.Name Then
'if yes, activate rStartCell's parent
rStartCell.Parent.Activate
End If
rStartCell.Activate

End Sub


--
Hope that helps.

Vergel Adriano


"Jock" wrote:

Apologies if I was being unclear.
At top of worksheet (in cell I3), I have a button with macro which, when
clicked goes to AA15 (for instance).
As time goes on, the user could be on row 2000, but can still access the
button at the top taking him to AA15. I would like the button (and macro)
next to AA15 to take the user back to wherever he has just come from ie
A2000. Is this possible?
--
tia

Jock


"Gary''s Student" wrote:

O.K. If you want the Activecell address displayed in a cell, then:

Sub whereisactive()
Range("A1").Value = ActiveCell.Address
End Sub
--
Gary''s Student - gsnu200718

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 02:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"