Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Correct way to call active worksheet?
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to call a worksheet (as a function) | Excel Discussion (Misc queries) | |||
Altering code to reference the worksheet before the active worksheet | Excel Programming | |||
Call macro from active workbook-duplicate shortcut keys | Excel Programming | |||
Call VB6 DLL from Worksheet without VBA wrapper | Excel Programming | |||
macro to apply worksheet event to active worksheet | Excel Programming |