• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Using VBA to find a range of cells

Montrey

Member
Hey Guys, I've search high and low for what I'm trying to do and can't seem to find it.


I guess my main problem is that the range(s) I need to copy, can change in size. So what I'm thinking I need to find the cell where my range starts, and then find the cell where my range ends(there is always a blank row before the last row) and then I need to select all the rows in between and including the start and last cells rows.


In sum; I have a masterworksheet that has data for different departments. I need to copy & paste value each departments info into their own separate workbooks and save each file as the name of the department and a specified date. I then have to send each file to the specific departments contacts through Outlook.


I have to do this everyday, so I've been trying to figure out some VBA to do this. I've just been struggling on how to even get started, which would be to find the ranges i need to copy.


Thanks guys!
 
Hi Montrey ,


Can you not use dynamic named ranges , which maintain their size automatically , and which can be referenced in your code ?


If the first range will start from a fixed cell address , then all the remaining ranges can be addressed with reference to the first range. I assume each department data will be separated from the previous / next department data by a blank row ?


Narayan
 
Hi, Montrey!

Any chance of a sample file? Or the master worksheet structure? Or anything that might let us know how to settle the start and end blocks?

Regards!
 
Back
Top