+ Reply to Thread
Results 1 to 8 of 8

How to declare specific range on worksheet on workbook

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    How to declare specific range on worksheet on workbook

    Hi there,

    I have written this script to update a spreadsheet from another spreadsheet, but I think the code is a little messy and could be tidied up if I was able to use the variables the way I indended.

    Please Login or Register  to view this content.
    Basically, I would ideally like to use the variable of rSource and rDestination to refer to the specific ranges on a specific sheet on another workbook. Is there a better way to do this please.

    Kind regards

    Rob

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: How to declare specific range on worksheet on workbook

    Hi there,
    You can shorten f.e.:
    Please Login or Register  to view this content.
    can be done like:
    Please Login or Register  to view this content.
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: How to declare specific range on worksheet on workbook

    This uses rSource, rDestination and a new variable, wbDest, for the destination workbook.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Re: How to declare specific range on worksheet on workbook

    Hi Miroslav R., I tried that but get the error message "Object doesn't support this property or method"

  5. #5
    Forum Contributor
    Join Date
    02-16-2012
    Location
    London, England
    MS-Off Ver
    Excel mac 2011
    Posts
    238

    Re: How to declare specific range on worksheet on workbook

    So what does it mean then, "Object doesn't support this property or method"?

  6. #6
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: How to declare specific range on worksheet on workbook

    Which line of shortened code?

  7. #7
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: How to declare specific range on worksheet on workbook

    Replace 'Windows' with 'Workbooks' and it should be ok...
    Sorry but I did not get it before...

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: How to declare specific range on worksheet on workbook

    Rob K

    Was there a problem with the code I posted?
    Last edited by Norie; 05-30-2014 at 08:24 AM.

  9. #9
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: How to declare specific range on worksheet on workbook

    No was not...
    The problem was in my shortened code... I was refferencing to sheeet/range in window and tha was the error. Sheet/range only exist in workbook.
    Did You replace that?
    Is it OK now?

+ 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. Call a specific workbook from a file location and move worksheet to different workbook
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 01:46 AM
  2. [SOLVED] Copy worksheet with specific name and no blank cell in a specific range
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-05-2013, 11:50 AM
  3. [SOLVED] Copy Data from Range on Specific Worksheet and Transfer Data to New Workbook
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2013, 08:24 AM
  4. Syntax to call a specific workbook and specific worksheet using VBA?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2013, 05:32 PM
  5. Replies: 2
    Last Post: 04-10-2005, 07:07 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