jkwleisemann
New Member
- Joined
- May 31, 2016
- Messages
- 19
Good morning, everybody!
I have to update a *ton* of tables in an Excel spreadsheet, rolling them forward for the new year. For example, if WRSState is in cells A6:H15, I need to copy rows A7:H15 into A6:H14, clear A15:H15, and then make a couple of other edits that i should be able to figure out.
But I've got about 50 tables, so I'd really rather not do this manually. And they're spread out over a lot of different worksheets.
The sort of thing that should be a macro, I think.
What I'm trying to figure out is how I can set up things like referencing the final row, referencing the final column, that type of thing. I'm pretty sure that I can do things like:
But I'm not sure how to fill in the "?" in that.
Also, I'd like to try and iterate through the named ranges, rather than have to type out each one. Can i do something like this?
Or is there some other way to set this up?
Or should I just start keying and stop trying to be cute about how I do it?
I have to update a *ton* of tables in an Excel spreadsheet, rolling them forward for the new year. For example, if WRSState is in cells A6:H15, I need to copy rows A7:H15 into A6:H14, clear A15:H15, and then make a couple of other edits that i should be able to figure out.
But I've got about 50 tables, so I'd really rather not do this manually. And they're spread out over a lot of different worksheets.
The sort of thing that should be a macro, I think.
What I'm trying to figure out is how I can set up things like referencing the final row, referencing the final column, that type of thing. I'm pretty sure that I can do things like:
Code:
Range("Name").cells(R1C0, R?C?)
But I'm not sure how to fill in the "?" in that.
Also, I'd like to try and iterate through the named ranges, rather than have to type out each one. Can i do something like this?
Code:
For i = 1 to Worksheets.Count
For Each Range in Worksheets(i)
(Code and stuff)
Next
Next
Or is there some other way to set this up?
Or should I just start keying and stop trying to be cute about how I do it?
Last edited: