+ Reply to Thread
Results 1 to 3 of 3

How to code an overwrite or append via radio button

  1. #1
    Registered User
    Join Date
    07-09-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    80

    How to code an overwrite or append via radio button

    Hello!
    I have a small userform I designed. The top is a combobox which will have 10 csv files to pick from. The bottom is an open command button which allow the user to open any file anywhere. Lastly, is a radio button that says overwrite. Since I'm new to vba, I need to code the ok button so that if the radio button is ticked (on) it will take the file contents in the Open field and replace whatever is in the combobox file. If it's not ticked (off), it will append instead. I haven't the slightest how to code this except as an if-then scenario. I've been looking for some specific examples, but so far no luck. Any advice for this novice?

    Thanks,
    Jeff

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: How to code an overwrite or append via radio button

    Hi dovermac,

    See the attached sample file, which will probably point you in the right direction. I added a second OptionButton, so you select either 'OverWrite' or 'Append', which is how I would do it if it were my project.

    Please ask if you don't understand, or have any more problems or questions.

    Lewis
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-09-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    80

    Re: How to code an overwrite or append via radio button

    Thanks Lewis!!!

+ 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. [SOLVED] append data only if date is different, otherwise overwrite
    By roothog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2015, 05:06 PM
  2. macro code depanding on radio button
    By prajakt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2011, 08:27 AM
  3. Need VBA code to hide cells if radio button in another cell is chosen
    By sqearly in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-26-2011, 01:10 PM
  4. Run code whenever any radio button is clicked
    By rwalk9sr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2007, 06:01 PM
  5. Overwrite instead of append on publish
    By KLEBESTIFT in forum Excel General
    Replies: 0
    Last Post: 05-11-2006, 12:30 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