+ Reply to Thread
Results 1 to 6 of 6

How to find the range of cells(Only having data) in a sheet using vba?

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    7

    How to find the range of cells(Only having data) in a sheet using vba?

    Hi,

    I would like to find the range of cells in a sheet which looks like as given below. Assume that in the last two columns, data was entered and later on deleted.

    Name 04/17/2015 04/18/2015
    ABC 10 11
    XYZ 50 60
    KMN 10 05
    RTW 45 60

    How do I get only the range of cell which is currently having some values in it? Kindly help.
    Note: I tried using 'UsedRange' which gives the cell range including last two columns.

    Thanks in advance.
    Last edited by krkarthik; 04-22-2015 at 01:19 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How to find the range of cells(Only having data) in a sheet using vba?

    Hi krkarthik

    Something like this perhaps
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to find the range of cells(Only having data) in a sheet using vba?

    Closing and reopening the file should reset the used range.

    Failing that.

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    04-16-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    7

    Re: How to find the range of cells(Only having data) in a sheet using vba?

    Hi jaslake,

    Thanks for the reply. Your code helped me to solve my scenario.

    Thank you.

  5. #5
    Registered User
    Join Date
    04-16-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    7

    Re: How to find the range of cells(Only having data) in a sheet using vba?

    Hi mehmetcik,

    Thanks for the reply.

    Thank you.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: How to find the range of cells(Only having data) in a sheet using vba?

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. [SOLVED] Find The Match For All The Cells From A Range In Another Sheet And Use Their Color
    By taccoo73 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-25-2014, 10:45 AM
  2. Find Date Range data's and paste the next sheet blank row.
    By rskfriends in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2013, 03:41 AM
  3. VBA macro to Find a dynamic range of cells, copy then paste to another sheet
    By Bmxerdude2087 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 02:36 PM
  4. find data within a range of cells
    By sirdragon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2011, 05:36 PM
  5. [SOLVED] Loop Through A Range, Find Cells > 1, Copy Offset To Another Sheet
    By bugmenot in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-25-2008, 06:30 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