Thread
:
Variable not defined?
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Variable not defined?
Option Explicit
Sub WklySumWS()
Dim wbWkly As Workbook
Dim wsWklyLst As Worksheet
Dim wsWklySum As Worksheet
Dim sWklyShtName As String
Set wsWklyLst = ActiveSheet
sWklyShtName = wsWklyLst.Name
'=========
Sheets.Add
ActiveSheet.Name = sWklyShtName & " Summary"
]=============
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"davegb" wrote in message
...
I just started writing some new code, went to test the first few
lines, but I'm getting a "variable not defined" error on the name of
my subroutine. Anybody know what's wrong with the name?
Sub WklySumWS() <------- VARIABLE NOT DEFINED
Dim wbWkly As Workbook
Dim wsWklyLst As Worksheet
Dim wsWklySum As Worksheet
Dim sWklyShtName As String
Set wsWklyLst = ActiveSheet
sWklyShtName = wsWklyLst.Name
Sheets.Add.Activate
wsWklySum = ActiveSheet
ActiveSheet.Name = sWklyShtName & " Summary"
End Sub
Thanks for the help!
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett