Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Correct way to call active worksheet?

Hello,

What is the correct way to call upon the active worksheet?
I want my code to call the active worksheet (ActiveSheet) that I am
currently in, rather than calling up a certain sheet by name as I am doing
below:

Private Sub CBWP_Click()
Worksheets("BIDWORKUP").Range("B48").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H48").Value = 1.45
Worksheets("BIDWORKUP").Range("B62").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H62").Value = 1#
End Sub

Help!

LB


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Correct way to call active worksheet?

Replace Worksheets("name_of_sheet") with ActiveSheet
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Locutis" wrote:

Hello,

What is the correct way to call upon the active worksheet?
I want my code to call the active worksheet (ActiveSheet) that I am
currently in, rather than calling up a certain sheet by name as I am doing
below:

Private Sub CBWP_Click()
Worksheets("BIDWORKUP").Range("B48").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H48").Value = 1.45
Worksheets("BIDWORKUP").Range("B62").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H62").Value = 1#
End Sub

Help!

LB



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Correct way to call active worksheet?

Think Don actually meant:


with activesheet
..Range("B48") = "Waterproofing"
..Range("H48") = 1.45
..Range("B62") = "Waterproofing"
..Range("H62") = 1#
end with

since there is no ActiveWorksheet object (although I try to use it all the
time <g)

--
Regards,
Tom Ogilvy'


"Don Guillett" wrote in message
...
this might be better

with activeworksheet
.Range("B48") = "Waterproofing"
.Range("H48") = 1.45
.Range("B62") = "Waterproofing"
.Range("H62") = 1#
end with

--
Don Guillett
SalesAid Software

"Locutis" wrote in message
...
Hello,

What is the correct way to call upon the active worksheet?
I want my code to call the active worksheet (ActiveSheet) that I am
currently in, rather than calling up a certain sheet by name as I am

doing
below:

Private Sub CBWP_Click()
Worksheets("BIDWORKUP").Range("B48").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H48").Value = 1.45
Worksheets("BIDWORKUP").Range("B62").Value = "Waterproofing"
Worksheets("BIDWORKUP").Range("H62").Value = 1#
End Sub

Help!

LB






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
How to call a worksheet (as a function) Bernie Excel Discussion (Misc queries) 18 April 20th 09 06:15 PM
Altering code to reference the worksheet before the active worksheet KimberlyC Excel Programming 8 March 15th 05 10:26 PM
Call macro from active workbook-duplicate shortcut keys James[_18_] Excel Programming 1 January 16th 04 05:53 PM
Call VB6 DLL from Worksheet without VBA wrapper Lawrence[_3_] Excel Programming 2 September 19th 03 10:04 AM
macro to apply worksheet event to active worksheet Paul Simon[_2_] Excel Programming 3 August 7th 03 02:50 AM


All times are GMT +1. The time now is 04:23 PM.

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"