+ Reply to Thread
Results 1 to 3 of 3

Combine two codes into one

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Combine two codes into one

    Hi guys,

    Can somebody help me to combine the code in red with the code in blue.

    This is what i would like achieve:
    If the textbox "txtQty" is blank exit sub, but if "txtQty" textbox has a value and "sw1" combobox is blank then "sw1.Value = CommandButton5.Caption" but if "txtQty" textbox has a value and "sw1" combobox has a value then sw2.Value = CommandButton5.Caption. But if the combobox "cmbOnline".Value = "Standard" Then execute code in blue.

    I'm so stuck, I would appreciate any help.
    Thanks in advance

    Please Login or Register  to view this content.
    Last edited by intex; 10-14-2014 at 03:19 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combine two codes into one

    Since the red code is part of the blue code, just split them, so perhaps:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    08-08-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    152

    Re: Combine two codes into one

    Thanks a lot it does exactly what i need,perfect!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do i combine two codes to run together
    By Sam2149 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2014, 05:42 PM
  2. Combine 2 codes
    By Minhaz.iubat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2014, 05:46 AM
  3. [SOLVED] How to combine these two set's of codes?
    By aadeshgandhi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2013, 07:26 PM
  4. combine codes
    By Oeysbrei in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-30-2012, 03:38 AM
  5. Combine vba codes
    By mmwltd in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-22-2010, 08:32 AM

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