+ Reply to Thread
Results 1 to 6 of 6

Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    A third party program we use produces a report to Excel 2010, the number rows of data varies each week.

    A macro is run on the report which returns using countif() the number of instances of 5 differeing strings.

    Using 'Range("K65536").End(x1Up).Select', which works out the last cell containing data.
    and the using 'ActiveCell.Formula = "=Countif(K:K,""string"")"

    Question: I wish to use the same row count above to sum another column of numerical data of which only a few rows contain data.

    If I Use:
    'Range("G65536").End(x1Up).Select'
    'ActiveCell.Formula = "=Sum(G:G)"
    The data is entered in the next empty cell and not on the same row as column K. I want to use the same row count as K:K..
    Any Ideas

    Regards

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    Try as follows

    Please Login or Register  to view this content.
    Last edited by JasperD; 05-07-2013 at 09:52 AM.

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    maybe something like
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    Hi, patel45,

    your code should create a circular refernce as the cells you write the formula to are included in the range of what is to be summed (as well as JasperD code for sum), and the second formula is not correct (should be CountIf not Sum).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Registered User
    Join Date
    05-07-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Range("K65536").End(x1Up).Select ....... How to use same row count elswhere?

    Thanks for the help I used the suggestion by JasperD and modified it using an offset to place the result in the correct position.
    However, I am sure all the suggestions would also have worked as well.

    How do I now show the Thread as solved I can't seem to find that option?

    Thanks
    Last edited by Apache_sim; 05-08-2013 at 03:44 AM. Reason: Spelling

+ 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