Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default How to indicate that the current visible worksheet is the active o

Good day,

I have a function in a module, in which I would like to state that the
current visible worksheet should be treated as the active one, because I do
not know during execution what the sheet name will be. In the example below
the sheet name is hardcoded, what is the better solution?

With ActiveWorkbook
With .Worksheets("Titans")
.Range("M5").Value = 5
End With
End With

Kind regards

George



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to indicate that the current visible worksheet is the active o

Hi George,

Dim SH As Worksheet

Set SH = ActiveSheet

SH.range("M5").Value = 5

The object variable SH will refer to the stipulated sheet, irrespective of
whether it is subsequently active or not..


---
Regards,
Norman


"George Furnell" wrote in message
...
Good day,

I have a function in a module, in which I would like to state that the
current visible worksheet should be treated as the active one, because I
do
not know during execution what the sheet name will be. In the example
below
the sheet name is hardcoded, what is the better solution?

With ActiveWorkbook
With .Worksheets("Titans")
.Range("M5").Value = 5
End With
End With

Kind regards

George





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
Populate current active cell - Help Please!! Larry Excel Worksheet Functions 0 July 19th 06 10:19 PM
HOW DO I REVERT SCROLL BOX TO CURRENT VISIBLE WINDOW? bak Excel Discussion (Misc queries) 1 April 18th 06 04:35 PM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
How to make sure a Cell is within the current visible window's ran OKLover[_2_] Excel Programming 2 July 13th 05 01:38 PM
Worksheet has to set to visible as it is not visible after saving and closing Excel by VB. Oscar Excel Programming 6 June 21st 05 10:39 PM


All times are GMT +1. The time now is 08:20 PM.

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"