Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following snippet of code which when run in Excel 10 works fine,
but for some reason doesn't work in Excel 11. Can anyone offer any solutions for this please? I have a form which users input a number as a string lets says it's "1150" This is the part that doesn't work - it doesn't activate the respective workbook Workbooks(AName & " - (1000-1999)").Activate SNIPPET AName = Left(ActiveWorkbook.Name, 14) ControlBook = ActiveWorkbook.Name On Error GoTo NewBadge If IsNumeric(BadgeNumber) Then lBadge = CLng(BadgeNumber) Select Case lBadge Case 1 To 1000 Workbooks(AName & " - (1000-1999)").Activate ' this on error causes a fail to find to go to create a new record Worksheets(BadgeNumber).Activate Application.StatusBar = "You are now editing " + BadgeNumber + "'s " + AName + " record...." etc.... -- Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's no extension suffix on the workbook name (.xls). Did your Windows
settings change? Default in Windows (a stupid choice if you ask me and thousands of others) is not to show the extension for known file types. If the setting changes, your workbook name is insufficient to find the workbook you want. What's the error message, by the way? - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Mark" wrote in message ... I have the following snippet of code which when run in Excel 10 works fine, but for some reason doesn't work in Excel 11. Can anyone offer any solutions for this please? I have a form which users input a number as a string lets says it's "1150" This is the part that doesn't work - it doesn't activate the respective workbook Workbooks(AName & " - (1000-1999)").Activate SNIPPET AName = Left(ActiveWorkbook.Name, 14) ControlBook = ActiveWorkbook.Name On Error GoTo NewBadge If IsNumeric(BadgeNumber) Then lBadge = CLng(BadgeNumber) Select Case lBadge Case 1 To 1000 Workbooks(AName & " - (1000-1999)").Activate ' this on error causes a fail to find to go to create a new record Worksheets(BadgeNumber).Activate Application.StatusBar = "You are now editing " + BadgeNumber + "'s " + AName + " record...." etc.... -- Mark |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks, I'll try it out.
No error message just puts a new sheet with the details in the wrong workbook for that particular number. -- Mark "Jon Peltier" wrote: There's no extension suffix on the workbook name (.xls). Did your Windows settings change? Default in Windows (a stupid choice if you ask me and thousands of others) is not to show the extension for known file types. If the setting changes, your workbook name is insufficient to find the workbook you want. What's the error message, by the way? - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Mark" wrote in message ... I have the following snippet of code which when run in Excel 10 works fine, but for some reason doesn't work in Excel 11. Can anyone offer any solutions for this please? I have a form which users input a number as a string lets says it's "1150" This is the part that doesn't work - it doesn't activate the respective workbook Workbooks(AName & " - (1000-1999)").Activate SNIPPET AName = Left(ActiveWorkbook.Name, 14) ControlBook = ActiveWorkbook.Name On Error GoTo NewBadge If IsNumeric(BadgeNumber) Then lBadge = CLng(BadgeNumber) Select Case lBadge Case 1 To 1000 Workbooks(AName & " - (1000-1999)").Activate ' this on error causes a fail to find to go to create a new record Worksheets(BadgeNumber).Activate Application.StatusBar = "You are now editing " + BadgeNumber + "'s " + AName + " record...." etc.... -- Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA Excel code not working properly (HELP!) | Excel Discussion (Misc queries) | |||
My code is still not working -- Excel 2000 Worksheet protection | Excel Programming | |||
Excel 2000 VBA Code not working in Excel 2002 | Excel Programming | |||
Excel 2000 code not working in XP | Excel Programming | |||
Need advice and code help with working with *.dbf files in Excel 97 | Excel Programming |