Looking for a way to have workbook open to optionbutton5 if the workbook name is Price Example ActiveXv2,if not then open workbook to how
it was saved.?
Thanks for suggestions Z
Looking for a way to have workbook open to optionbutton5 if the workbook name is Price Example ActiveXv2,if not then open workbook to how
it was saved.?
Thanks for suggestions Z
Last edited by zplugger; 05-04-2015 at 09:21 AM.
Dim wb As Workbook Set wb = ThisWorkbook If wb.Name = "Price Example using ActiveX v2.xlsm" Then Sheets("Products").OptionButton5 = True End If
Thanks davesexcel,almost there. It does set the option button right but sheet one is not update until you do sheet change. My default it will open to
sheet1,so is it possible to have it set right on open. The Price Example using ActiveX v2.xlsm in upper post show better.
Thanks
Maybe I'm going at this the wrong way, looking for any suggestions.
Thanks Z
I don't know what your asking, put the code anywhere you want.
Thank You
This part of the code works perfect,but it will not update sheet1 with correct data.On the sheet with optionbuttons there is a commandbutton to run this code to update sheet1.
Dim wb As Workbook Set wb = ThisWorkbook If wb.Name = "Price Example using ActiveX v2.xlsm" Then Sheets("Products").OptionButton5 = True End If
Here is update code,tried to add to workbook open with no luck.
need a way to click the button on open,not sure how to do this?.Private Sub cmdUpdate_Click() Dim cCont As Object For Each cCont In ActiveSheet.OLEObjects If cCont.Name Like "OptionButton?" Then If cCont.Object.Value = True Then Sheets("Sheet1").lblName.Object.Caption = cCont.Object.Caption Sheets("products").Range("i13") = cCont.Object.Caption End If End If Next cCont End Sub
Thanks Z
added a welcome button on sheet 1 but it will not run the code from sheet1,runs from products sheet?
Try this,
Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim wb As Workbook Set wb = ThisWorkbook If wb.Name = "Price Example using ActiveX v2.xlsm" Then Sheets("Products").OptionButton5 = True Sheets("Sheet1").lblName.Object.Caption = Sheets("Products").OptionButton5.Caption Sheets("products").Range("i13") = Sheets("Products").OptionButton5.Caption End If wb.Save End Sub
Thanks davesexel works Perfect.
Z
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks