Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why do I get an error in the third line of this little code:
Dim WS As Worksheet Dim WB As Workbook WB = ThisWorkbook For Each WS In WB.Worksheets ???? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
WB is an object, so use
Set WB = ThisWorkbook HTH, Bernie MS Excel MVP "Charlotte E." wrote in message ... Why do I get an error in the third line of this little code: Dim WS As Worksheet Dim WB As Workbook WB = ThisWorkbook For Each WS In WB.Worksheets ???? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
workbook is an object so use this:
Set WB = ThisWorkbook -- Gary "Charlotte E." wrote in message ... Why do I get an error in the third line of this little code: Dim WS As Worksheet Dim WB As Workbook WB = ThisWorkbook For Each WS In WB.Worksheets ???? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to both Bernie and Gary :-)
"Gary Keramidas" <GKeramidasATmsn.com skrev i en meddelelse ... workbook is an object so use this: Set WB = ThisWorkbook -- Gary "Charlotte E." wrote in message ... Why do I get an error in the third line of this little code: Dim WS As Worksheet Dim WB As Workbook WB = ThisWorkbook For Each WS In WB.Worksheets ???? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
OnTime code error "can't execute code in break mode" | Excel Programming | |||
Error in Excel VBA Code (Error 91) | Excel Programming | |||
How can I still go to the error-code after a On Error Goto? | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |