Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Buttons & ActiveX Controls
Dave Peterson/Bob Phillips
My apologies for not responding sooner as I was not home last night. The Code you provided below works well Thankyou very much. However, I would like to rename my worksheet (sheet1) to (IncidentDesription) but doing so, stops the Code below from working. so how can I rename the sheet to have it work with my commandbutton Public Sub MyButton_Click() application.goto Worksheets("Sheet2").range("X99"), scroll:=true 'or false?? End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Buttons & ActiveX Controls
If you wrote that Sheet2 was renamed, then you'd have to change this line:
application.goto Worksheets("Sheet2").range("X99"), scroll:=true to application.goto Worksheets("IncidentDesription").range("X99"), scroll:=true But I don't know why you're having trouble when you change the name of Sheet1--sheet1 is the name of the sheet that contains the commandbutton, right? (And remember to change x99 to the address of the cell that you want to go to.) aussiegirlone wrote: Dave Peterson/Bob Phillips My apologies for not responding sooner as I was not home last night. The Code you provided below works well Thankyou very much. However, I would like to rename my worksheet (sheet1) to (IncidentDesription) but doing so, stops the Code below from working. so how can I rename the sheet to have it work with my commandbutton Public Sub MyButton_Click() application.goto Worksheets("Sheet2").range("X99"), scroll:=true 'or false?? End Sub -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Buttons & ActiveX Controls
I had done that but I get a meesage (run-time error 9 Subscript out of range)
"Dave Peterson" wrote: If you wrote that Sheet2 was renamed, then you'd have to change this line: application.goto Worksheets("Sheet2").range("X99"), scroll:=true to application.goto Worksheets("IncidentDesription").range("X99"), scroll:=true But I don't know why you're having trouble when you change the name of Sheet1--sheet1 is the name of the sheet that contains the commandbutton, right? (And remember to change x99 to the address of the cell that you want to go to.) aussiegirlone wrote: Dave Peterson/Bob Phillips My apologies for not responding sooner as I was not home last night. The Code you provided below works well Thankyou very much. However, I would like to rename my worksheet (sheet1) to (IncidentDesription) but doing so, stops the Code below from working. so how can I rename the sheet to have it work with my commandbutton Public Sub MyButton_Click() application.goto Worksheets("Sheet2").range("X99"), scroll:=true 'or false?? End Sub -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Buttons & ActiveX Controls
Dave it worked Renaming the work sheet and the goto fixed the problem
thankyou very much. "Dave Peterson" wrote: If you wrote that Sheet2 was renamed, then you'd have to change this line: application.goto Worksheets("Sheet2").range("X99"), scroll:=true to application.goto Worksheets("IncidentDesription").range("X99"), scroll:=true But I don't know why you're having trouble when you change the name of Sheet1--sheet1 is the name of the sheet that contains the commandbutton, right? (And remember to change x99 to the address of the cell that you want to go to.) aussiegirlone wrote: Dave Peterson/Bob Phillips My apologies for not responding sooner as I was not home last night. The Code you provided below works well Thankyou very much. However, I would like to rename my worksheet (sheet1) to (IncidentDesription) but doing so, stops the Code below from working. so how can I rename the sheet to have it work with my commandbutton Public Sub MyButton_Click() application.goto Worksheets("Sheet2").range("X99"), scroll:=true 'or false?? End Sub -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Command Buttons & ActiveX Controls
If you renamed the worksheet and the code worked, then you probably either had a
typo on the tab of the worksheet or a typo in the code. To most programmers, typos aren't important--as long as they match every place they're used <vbg! aussiegirlone wrote: Dave it worked Renaming the work sheet and the goto fixed the problem thankyou very much. "Dave Peterson" wrote: If you wrote that Sheet2 was renamed, then you'd have to change this line: application.goto Worksheets("Sheet2").range("X99"), scroll:=true to application.goto Worksheets("IncidentDesription").range("X99"), scroll:=true But I don't know why you're having trouble when you change the name of Sheet1--sheet1 is the name of the sheet that contains the commandbutton, right? (And remember to change x99 to the address of the cell that you want to go to.) aussiegirlone wrote: Dave Peterson/Bob Phillips My apologies for not responding sooner as I was not home last night. The Code you provided below works well Thankyou very much. However, I would like to rename my worksheet (sheet1) to (IncidentDesription) but doing so, stops the Code below from working. so how can I rename the sheet to have it work with my commandbutton Public Sub MyButton_Click() application.goto Worksheets("Sheet2").range("X99"), scroll:=true 'or false?? End Sub -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Command Buttons & ActiveX Controls | Excel Discussion (Misc queries) | |||
Tab between ActiveX controls | Excel Discussion (Misc queries) | |||
ActiveX controls | Excel Discussion (Misc queries) | |||
ActiveX Controls | Excel Discussion (Misc queries) | |||
ActiveX Controls vs Form Controls | Excel Discussion (Misc queries) |