Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need help in being able to do the following:

  • In Worksheet A I have raw data.
  • In Worksheet B I have a template with formulas.
  • The data on Worksheet A change on a weekly basis.

I need to find a way to select the raw data from Worksheet A and insert it in Workbook B. The formulas of Workbook B are at the right of where raw data should be entered and also down at the end of the raw data. Clearly my problem is that I have totals and the number of rows of raw data change.

share|improve this question
Can you post in what you've tried thus far? – variant Apr 25 '12 at 21:39

There's a myriad of ways for doing this. I prefer to figure out how many rows I'm working with (i.e., where the data ends) and then set up my ranges based on those numbers. Determining the last row or column can also be done several ways as evidenced by several sites, including here and here. The way I do it is

lngLastRow = Cells.Find("*", searchorder:=xlByRows, searchdirection:=xlPrevious).Row
lngLastCol = Cells.Find("*", searchorder:=xlByColumns, searchdirection:=xlPrevious).Column

Once you know the last row/column, you can subtract for however many total rows you need, etc.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .