+ Reply to Thread
Results 1 to 5 of 5

Error setting range in transcribing macro

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Error setting range in transcribing macro

    Trying to write a macro to transcribe data from columns in Sheet1 to Rows in Sheet2. Assuming there is a blank between each record. I get an error on the "Set Rng1....." line.
    Please Login or Register  to view this content.
    Thanks in advance
    Last edited by ChemistB; 10-07-2009 at 05:02 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    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: Error setting range in transcribing macro

    Please Login or Register  to view this content.
    Also, your code assumes that the active sheet is Sheet1.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Error setting range in transcribing macro

    Thanks shg!
    That worked. I also had to change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    I'm not sure when "is nothing" can be used but now it's working great.

  4. #4
    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: Error setting range in transcribing macro

    Object variables are Nothing when not initialized or explicitly set to Nothing.

    A Variant (of which a cell value are one) can never be Nothing (it's not an object variable) but can be Empty.
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.
    Either is better than what you have, unless you want to test explicitly for a null string, in which case you should use
    Please Login or Register  to view this content.
    Last edited by shg; 10-07-2009 at 05:11 PM.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Error setting range in transcribing macro

    Thanks again shg! As usual, your help has been invaluable.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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