View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Command button help

Double check the worksheet name as invalid name will give out of range error.

"Anna B" wrote:

I have some command buttons on a userform. I want each of these command
buttons to take me to a different worksheet in the workbook. I am so new to
VBA and don't really understand it at all. I have the command button on the
form, I double click it to bring up the code window and it automatically puts
in

Private Sub EmployeeBenefits Click_()
End Sub

(EmployeeBenefits is the name of my command button) I have five of them
with different names)

I added the following to try to get it to go to the sheet...

Sheets("Employee Benefits").Select

It says it is out of range. Can someone help? I am clueless. Thanks.