+ Reply to Thread
Results 1 to 8 of 8

Selecting Multiple Cells using VBA in Excel 2013

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2007
    Posts
    45

    Selecting Multiple Cells using VBA in Excel 2013

    I thought this made sense, but I'm the only one that thinks so...

    What is a way to code this so that it works?

    Please Login or Register  to view this content.
    Jim Berglund
    Last edited by JBeaucaire; 06-22-2013 at 06:12 PM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Selecting Multiple Cells using VBA in Excel 2013

    Try this,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

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

    Re: Selecting Multiple Cells using VBA in Excel 2013

    Hmm, maybe with the use of a range variable, set the range to the cells desired, then copy them:

    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!)

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Selecting Multiple Cells using VBA in Excel 2013

    Jerry, you can use union to select as well. Or did I not understand you?

    Please Login or Register  to view this content.

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

    Re: Selecting Multiple Cells using VBA in Excel 2013

    I pasted your code into a module and ran it seems to work fine. Not for you?

    In general, my answers won't have "select" still in them, I always guide the OPs toward doing the "thing" directly, whatever it is, instead of selecting first. Personal preference.

  6. #6
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Selecting Multiple Cells using VBA in Excel 2013

    That is what I was stating, that you 'could' also use the union for selecting cells. (I did miss-understand your first statement in that case) I agree, that select is generally not used, but I usually just do what to OP asks. Probably not the best thing to do in all cases though.

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

    Re: Selecting Multiple Cells using VBA in Excel 2013

    Heh, understood. I resisted the urge to simply say, "Did you try it?".
    That usually doesn't get across I'm just being playful.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Selecting Multiple Cells using VBA in Excel 2013

    Just for variety,

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ 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