+ Reply to Thread
Results 1 to 6 of 6

How to make macro when cell range delimiter is a comment

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    Tampa,FL
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to make macro when cell range delimiter is a comment

    How to write a macro that searches across row one for a comment in a cell containing #LAST_COL selecting the cell before that
    and down the first column for a #LAST_ROW and selecting the cell before that for a copy?

    Row 38662 contained the #LAST_ROW comment
    Column CQ contained the #LAST_COL comment

    Starting point will always be cell A5

    Using developer tool and recording macro ended up with
    Range("A5:CP38661").Select
    Selection.Copy

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: How to make macro when cell range delimiter is a comment

    How about:
    Please Login or Register  to view this content.
    ?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    02-22-2013
    Location
    Tampa,FL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to make macro when cell range delimiter is a comment

    Run-time error '1004':
    Method 'Range' of object '_Global' failed

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: How to make macro when cell range delimiter is a comment

    I used #LAST_COLUMN rather than #LAST_COL - my mistake, little details. Try again without "UMN"

  5. #5
    Registered User
    Join Date
    02-22-2013
    Location
    Tampa,FL
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to make macro when cell range delimiter is a comment

    Close, macro copied everything I need it the macro to begin copy from A5 (first 4 rows contain directions) and then up the last row and last column but excluding them (these rows/columns are borders).

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: How to make macro when cell range delimiter is a comment

    Third time's a charm...
    Please Login or Register  to view this content.

+ 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