Greetings,
I'm a VBA newbie--I did a bit of programming in VBA for Access a couple years ago, but haven't had any opportunities to work in VBA for Excel--and I was hoping to solicit some advice for how I might go about performing the following task in VBA:
In Sheet1: I have a dataset consisting of 1000 rows of data and ~25 columns (B3:AB1003)
In Sheet2:
-The range A6:A29 is populated with transposed values from a single row from Sheet1 (Sheet1!Bx:Yx, where x is the active row number from Sheet1).
-Another cell in Sheet2, AZ3, is populated with Sheet1!ABx, where x is the active row number from Sheet1.
-A bunch of other cells in Sheet2 contain either constant (i.e., static) values or formulas that reference the populated values (Sheet2!A6:A29 and Sheet2!AZ3) or other formula cells in Sheet2....basically, there's a lot of calculations going on in this sheet!
-The range BL6:BL21 contains the final results of the calculations for the specific Sheet1 row.
In Sheet3:
-This sheet would be set up to contain a 1000row by 16column matrix containing the values calculated in Sheet2!BL6:BL21 for each of the Sheet1 rows (e.g., Sheet3, row 1 contains results for Sheet1, row 1).
What I'm hoping to do is automate the process of populating Sheet2 with each row from Sheet1 and outputting the final calculated results in Sheet3. I imagine the general steps would look something like this:
1) Copy relevant values from first row in Sheet1.
2) Paste the copied values from Sheet1 into the relevant ranges in Sheet2.
3) Update all the formula fields in Sheet2 to reflect the copied values.
4) Copy the range in Sheet2 containing the final calculated results.
5) Paste the transposed range in the first row of Sheet3.
6) Loop through all the rows in Sheet1, with the final calculated results pasted into the next empty row in Sheet 3.
Like I said, I'm very much new to Excel VBA, so at this point I'm hoping figure out how to best break down the task into steps that can be handled efficiently in VBA. I think once I get those steps figured out, I'll be much better positioned to dive into the voluminous Excel for VBA manual I have at my disposal! Any advice--general or specfic--would be very much appreciated!
Bookmarks