Open a workbook then goto a specific range

G

Guest

I have been searching the group to find an answer to this one, but can't find
anything that works and need some help.

I have a workbook called 'WRO Summary'. Cell K4 = the current month
(formatted 'mmm'). In another workbook called 'B Debt', there are named
cells, 'Jan', 'Feb', 'Mar', etc. In the workbook 'WRO Summary' I have a
macro that does a number of different things, but I need to do is copy a
range to a specific range in 'B Debt'. I can get the macro to open the B
Debt workbook, is there a way to look at cell K4 in 'WRO Summary' and go to
the named range in 'B Debt'. ie: WRO Summary, Cell K4 = 'Oct', then open
workbook 'B Debt' and go to range 'Oct'?
Once I get to this named range, I know how to find the next blank row etc.
to paste the data.

Thanks for your assistance.
 
G

Guest

You didn't specify the worksheet name or number so I used sheet 1 in both
workbooks. If different, change it.

selRng = Workbooks("WRO Summary").Sheets(1).Range("K4").Value
Workbooks("B Debt").Sheets(1).selRng.Activate
 
G

Guest

I tried your suggestion several different ways, it still doesn't recognize to
GoTo the named cell. There are multple users of the originating workbook so,
I have to change directories. Here's what I have:

ChDir "G:\SAVINGS"
Workbooks.Open Filename:="G:\B Debt.xls"
'selRng = Workbooks("WRO Summary").Sheets("WRO Memo").Range("K4").Value

It will open the workbook G:\B Debt.xls and remain in the exact cell where
it was last saved.

What am I doing wrong?
 
G

Guest

I think I've done something similar, but rather than going to the named range
'Oct', go to the column or row labeled 'Oct', and work from there:

Get into 'B Debt', and select the range with the labels Jan, Feb, Mar, etc.

For Each Item in Selection
If Item.Text = Workbooks("WRO Summary").Sheets(1).Range("K4").Text
'your code for copying/pasting
End if
Next Item
Application.CutCopyMode = False
 
G

Guest

Thanks for the input, it gave me an idea. I coded the file so it opens on
the worksheet for the specific month. Then within the macro, I specify the
range I need and work it from there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top