Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Get Active Sheet

I've got the worksheet and cell hard-coded below. What's the syntax to
replace "sheet1" withe name of the active worksheet and replace "a7" with
the active cell?

I'd like to be able to assign both above mentioned values to variables like
"pageActive" and "cellActive" and then be able to insert those variables
into the code below. I'm familiar with Access VBA, but don't know how to
treat Excel's vba variables and quotes.

CODE:

Worksheets("sheet1").Range("a7").Value


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Get Active Sheet

I'm not just 100% sure what you want but here goes

dim strActiveSheet as String
dim strActiveCell as String

strActiveSheet = ActiveSheet.Name
strActiveCell = ActiveCell.Address
Worksheets(strActiveSheet).Range(strActiveCell).Va lue

--
HTH...

Jim Thomlinson


"scott" wrote:

I've got the worksheet and cell hard-coded below. What's the syntax to
replace "sheet1" withe name of the active worksheet and replace "a7" with
the active cell?

I'd like to be able to assign both above mentioned values to variables like
"pageActive" and "cellActive" and then be able to insert those variables
into the code below. I'm familiar with Access VBA, but don't know how to
treat Excel's vba variables and quotes.

CODE:

Worksheets("sheet1").Range("a7").Value



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Get Active Sheet

that get's it.

"Jim Thomlinson" wrote in message
...
I'm not just 100% sure what you want but here goes

dim strActiveSheet as String
dim strActiveCell as String

strActiveSheet = ActiveSheet.Name
strActiveCell = ActiveCell.Address
Worksheets(strActiveSheet).Range(strActiveCell).Va lue

--
HTH...

Jim Thomlinson


"scott" wrote:

I've got the worksheet and cell hard-coded below. What's the syntax to
replace "sheet1" withe name of the active worksheet and replace "a7" with
the active cell?

I'd like to be able to assign both above mentioned values to variables
like
"pageActive" and "cellActive" and then be able to insert those variables
into the code below. I'm familiar with Access VBA, but don't know how to
treat Excel's vba variables and quotes.

CODE:

Worksheets("sheet1").Range("a7").Value





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
I need to sort an active sheet using the col of the active cell HamFlyer Excel Programming 3 June 6th 06 07:25 PM
Active Cell Copy And Paste Sheet to Sheet A.R.J Allan Jefferys New Users to Excel 4 May 4th 06 02:04 AM
Copy my active sheet to a new sheet and open with an input form Brad Withrow Excel Programming 0 April 6th 06 03:56 AM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
Calculate active sheet on sheet selection a94andwi[_11_] Excel Programming 1 September 26th 05 05:23 PM


All times are GMT +1. The time now is 11:47 AM.

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

About Us

"It's about Microsoft Excel"