+ Reply to Thread
Results 1 to 8 of 8

Range and Rows.Count syntax error

  1. #1
    Forum Contributor
    Join Date
    09-15-2012
    Location
    Jamaica
    MS-Off Ver
    Microsoft 365
    Posts
    244

    Range and Rows.Count syntax error

    Hello, can someone help me correct this syntax error. I have tried a few different ways that I think should work along with trying to Google it, still errors.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Range and Rows.Count syntax error

    Data = Worksheets("LINE 11 TP").Range("A4", Cells(Rows.Count, "I").End(xlUp).Row)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Range and Rows.Count syntax error

    If activesheet not sheets("Line 11 TP").
    Please Login or Register  to view this content.
    Or:
    Please Login or Register  to view this content.
    Kind regards, Harry.

  4. #4
    Valued Forum Contributor
    Join Date
    05-03-2022
    Location
    Halifax,Canada
    MS-Off Ver
    365
    Posts
    326

    Re: Range and Rows.Count syntax error

    HSV .. Great Catch !
    So many people miss that when they code ( myself included)
    Last edited by nimrod1313; 08-23-2022 at 04:57 PM.

  5. #5
    Forum Contributor
    Join Date
    09-15-2012
    Location
    Jamaica
    MS-Off Ver
    Microsoft 365
    Posts
    244

    Re: Range and Rows.Count syntax error

    Thank you alansidman

  6. #6
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Range and Rows.Count syntax error

    I'm sorry, but I really can't approve of this.
    That addition from @alansidman really doesn't help you.

  7. #7
    Forum Contributor
    Join Date
    09-15-2012
    Location
    Jamaica
    MS-Off Ver
    Microsoft 365
    Posts
    244

    Re: Range and Rows.Count syntax error

    I just got a chance to test the code you sent alansidman, but it doesnt work. Thank you for the effort though, probably you overlooked something.

  8. #8
    Forum Contributor
    Join Date
    09-15-2012
    Location
    Jamaica
    MS-Off Ver
    Microsoft 365
    Posts
    244

    Re: Range and Rows.Count syntax error

    Thank you @HSV, your code worked perfectly.

+ 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. Syntax ERROR in Range
    By nordicdust in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2018, 04:28 PM
  2. [SOLVED] Set Range syntax - currently causing #value! error sometimes
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 03:11 PM
  3. Out of range error Possible syntax error?
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2014, 06:30 AM
  4. [SOLVED] Syntax error in Hide Unused Rows Macro
    By Damjag in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 09:10 AM
  5. [SOLVED] Syntax error for rows selection
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-07-2013, 05:11 AM
  6. [SOLVED] Syntax Errors for VBA for Rows count
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2013, 02:04 AM
  7. Rows.Count error in dynamic range naming
    By Andrew-Mark in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-07-2010, 03:27 AM

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