+ Reply to Thread
Results 1 to 4 of 4

Multiple ranges under one command button

Hybrid View

  1. #1
    Registered User
    Join Date
    04-26-2016
    Location
    Gothenburg, Sweden
    MS-Off Ver
    2010
    Posts
    2

    Multiple ranges under one command button

    Hi,

    I have a question regarding putting multiple ranges that shows when I click a command button.

    I have the ranges C106:D118,D200:D202,C256:I260 that I need to be put in cell D4 when I click a command button.

    How do I program this in VBA?

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Multiple ranges under one command button

    I have the ranges C106:D118,D200:D202,C256:I260 that I need to be put in cell D4
    What do you mean by this? The values from all of those cells into D4? If so, how do you want it formatted?

    Or are you asking for something else.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    04-26-2016
    Location
    Gothenburg, Sweden
    MS-Off Ver
    2010
    Posts
    2

    Re: Multiple ranges under one command button

    Yes, it's basically text in these ranges that I want to be pasted in D4 when I hit the button.

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Multiple ranges under one command button

    No formatting, as none was specified:

    For Each c In Range("C106:D118,D200:D202,C256:I260")
    x = x & c.Value
    Next
    [D4].Value = x

+ 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] Using checkboxes to delete specific ranges of cells via command button
    By Spykeeboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2016, 04:47 AM
  2. Replies: 2
    Last Post: 02-02-2016, 10:27 PM
  3. Insert Command Button that will Activate Command Button on a Different Sheet
    By realvirtuality1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2016, 02:11 PM
  4. VBA code to create command button. Print all sheets then delete command button.
    By Declamatory in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-15-2015, 05:18 PM
  5. Code for a master command button to change the backcolor of multiple command buttons?
    By panttherm5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2012, 10:11 PM
  6. selecting multiple graph ranges using the cells command
    By jw191 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2008, 09:13 AM
  7. Replies: 1
    Last Post: 09-17-2007, 09:57 PM

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