+ Reply to Thread
Results 1 to 9 of 9

link commandbuttons on userform and sheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    link commandbuttons on userform and sheet

    hi
    i have now sorted most of this apart from linking commandbuttons together ,i have cmd1 on frmret,cmd2 on sheet3,cmd3 and cmd4 on frmret,these need to
    be done in this order,cmd1 saves to sheet3,then cmd2 combines together,cmd3 then posts to sheet4,cmd4 then deletes,have done the rounds on the forums
    and can not figure this one out at all,does any one know the best way to do this please,ideas,pointers anything at all would be gratefully received
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 04-18-2013 at 03:28 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: link commandbuttons on userform and sheet

    Hi,

    there is no "cmd1" in your example code, instead you have at least 9 times used "CommandButton1". could you be more specific?

    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: link commandbuttons on userform and sheet

    hi
    sorry the buttons are commandbutton1 on frmret,commandbutton2 on sheet3,and commandbutton3 and 4 back on frmret,they need to execute in that order to work
    no1 saves,n02 cobines,no3 puts posted in cell and posts all to sheet4,no4 deletes posted rows
    hope this explains,also when you run frmret top right boxes picks up name,company,location from sheet3 but only ever picks first line entered if you return another
    item that someone else drew out it does not change to suit
    hope this explains
    many thanks colin

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: link commandbuttons on userform and sheet

    Sooo,
    1. commandbutton1 on frmret
      does not exist, instead we have the following buttons there:
      • cmdAdd
      • cmdUpdate
      • CommandButton3
      • CommandButton4
      • CommandButton5
      • CommandButton6
      • CommandButton7
      • CommandButton8
      • CommandButton11
      • CommandButton18

    2. commandbutton2 on sheet3
      does not exist, there is only "CommandButton1"

    Please check the file you uploaded.

    Regards

  5. #5
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: link commandbuttons on userform and sheet

    hi
    humble apologies i renamed these, but not code headings,again in order cmdadd-------frmret,commandbutton1---------sheet3,commandbuton11----------frmret and commandbutton18------frmret
    just not sure if you can switch between userform and sheet and userform again condensing these 4 buttons into one
    many thanks colin

  6. #6
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: link commandbuttons on userform and sheet

    hi,

    make sure all buttons affected have "Public" in their click event and then use
    Sub ClickButtons()
    
        FRMRET.cmdAdd_Click
        Sheet3.CommandButton1_Click
        FRMRET.CommandButton11_Click
        FRMRET.CommandButton18_Click
        
    End Sub
    Regards

  7. #7
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: link commandbuttons on userform and sheet

    hi
    stops at sheet3. CommandButton1_Click method or data member not found
    any ideas cheers colin

  8. #8
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: link commandbuttons on userform and sheet

    make sure all buttons affected have "Public" in their click event

    e.g.:
    Public Sub Commandbutton1_Click
    instead of
    Private Sub Commandbutton1_Click

  9. #9
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: link commandbuttons on userform and sheet

    hi
    many thanks
    not sure what the difference is between public and private,will look it up
    many thanks
    colin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1