Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
not able to set a sheet name having two dots.
Can any one help? When i try to put this code in excel 2003 and run, i get "Subscript out of range" runtime error 9. But in 2000 it was not there.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim tmpWB As Workbook Set tmpWB = Workbooks.Open("c:\208.Face-Centered_CCD.table", 0, True, 2) Dim tmpSheet As New Worksheet Dim s As String s = Left("208.Face-Centered_CCD.table", 31) MsgBox s Set tmpSheet = Sheets(Left("208.Face-Centered_CCD.table", 31)) MsgBox tmpSheet.Name End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
not able to set a sheet name having two dots.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim tmpWB As Workbook Set tmpWB = Workbooks.Open("c:\208.Face-Centered_CCD.table", 0, True, 2) Dim tmpSheet As Worksheet Dim s As String s = "208.Face-Centered_CCD.table" MsgBox s On Error Resume Next Set tmpSheet = Sheets(s) On Error goto 0 if tmpSheet is nothing then Msgbox "No sheet named " & s else MsgBox tmpSheet.Name End if End Sub -- Regards, Tom Ogilvy "Laks" wrote in message ... Can any one help? When i try to put this code in excel 2003 and run, i get "Subscript out of range" runtime error 9. But in 2000 it was not there. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim tmpWB As Workbook Set tmpWB = Workbooks.Open("c:\208.Face-Centered_CCD.table", 0, True, 2) Dim tmpSheet As New Worksheet Dim s As String s = Left("208.Face-Centered_CCD.table", 31) MsgBox s Set tmpSheet = Sheets(Left("208.Face-Centered_CCD.table", 31)) MsgBox tmpSheet.Name End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Leading dots...trailing dots | Excel Discussion (Misc queries) | |||
Leader Dots Between Cells | New Users to Excel | |||
leading dots | Excel Discussion (Misc queries) | |||
Change dots to commas!! | Excel Discussion (Misc queries) | |||
dots instead of grid lines | Excel Worksheet Functions |