Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Open a workbook then goto a specific range

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.
--
Linda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Open a workbook then goto a specific range

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

"mathel" wrote:

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.
--
Linda

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Open a workbook then goto a specific range

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?
--
Linda


"JLGWhiz" wrote:

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

"mathel" wrote:

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.
--
Linda

  #4   Report Post  
Posted to microsoft.public.excel.programming
dj dj is offline
external usenet poster
 
Posts: 92
Default Open a workbook then goto a specific range

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 the

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


"mathel" wrote:

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.
--
Linda

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Open a workbook then goto a specific range

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.
--
Linda


"DJ" wrote:

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 the

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


"mathel" wrote:

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.
--
Linda

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open a new workbook with a specific name Jepane Excel Discussion (Misc queries) 3 June 21st 07 04:09 PM
Open a specific workbook...find value from other open workbook and then insert cells values in cell next to it. [email protected] Excel Programming 1 May 13th 07 01:46 PM
Open Specific Sheet in Workbook jhahes[_9_] Excel Programming 1 June 24th 05 09:26 PM
Open workbook to specific worksheet Dave Excel Discussion (Misc queries) 2 May 2nd 05 08:44 PM
Check sheets name and open goto workbook Mark Excel Programming 1 February 7th 05 12:23 PM


All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"