Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #5   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.



  #6   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #8   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #9   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.



  #11   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

Here is some code that wil create 4 workbookssave them to c:\SLP and then
activate Book2.xls and select sheet2.
Maybe this help you.

Sub SLP()
Dim i As Integer
Dim NewWkbk As Workbook
Dim Oldbook As String

'this works if you are using excel 2003 change the file extension to .xlsx
if using 2007

For i = 1 To 4
Set NewWkbk = Workbooks.Add
ActiveWorkbook.SaveAs "C:\SLP\Book" & i
If ActiveWorkbook.Name = "Book3.xls" Then
Oldbook = ActiveWorkbook.Name
End If
Next i

Windows(Oldbook).Activate
Sheets("sheet2").Select

End Sub

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #14   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.



  #16   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Oh, OK, thank you. The third sheet (ComparisonAndModify) is active. It is
the sheet where the BTITemp workbook (workbook 3) puts its data. I need my
end users back on the second sheet (Buttons) as they have two more steps to
do at this point.

"JRForm" wrote:

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

The code to call the sheet is correct. Try launching the macro recorder and
then select different sheets and make sure one of them is Buttons. Then look
at the code and verify the sheet name.

"SLP" wrote:

Oh, OK, thank you. The third sheet (ComparisonAndModify) is active. It is
the sheet where the BTITemp workbook (workbook 3) puts its data. I need my
end users back on the second sheet (Buttons) as they have two more steps to
do at this point.

"JRForm" wrote:

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #18   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

Did that and the sheet name is correct. It still won't activate the Buttons
sheet. BTW, I really appreciate all the help.

"JRForm" wrote:

SLP,

The code to call the sheet is correct. Try launching the macro recorder and
then select different sheets and make sure one of them is Buttons. Then look
at the code and verify the sheet name.

"SLP" wrote:

Oh, OK, thank you. The third sheet (ComparisonAndModify) is active. It is
the sheet where the BTITemp workbook (workbook 3) puts its data. I need my
end users back on the second sheet (Buttons) as they have two more steps to
do at this point.

"JRForm" wrote:

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #19   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default maximize one of three minimized workbooks to certain sheet

SLP,

What cell is active? Try putting this code right before the call to the
sheet button
Application.CutCopyMode = False

"SLP" wrote:

Did that and the sheet name is correct. It still won't activate the Buttons
sheet. BTW, I really appreciate all the help.

"JRForm" wrote:

SLP,

The code to call the sheet is correct. Try launching the macro recorder and
then select different sheets and make sure one of them is Buttons. Then look
at the code and verify the sheet name.

"SLP" wrote:

Oh, OK, thank you. The third sheet (ComparisonAndModify) is active. It is
the sheet where the BTITemp workbook (workbook 3) puts its data. I need my
end users back on the second sheet (Buttons) as they have two more steps to
do at this point.

"JRForm" wrote:

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

  #20   Report Post  
Posted to microsoft.public.excel.programming
SLP SLP is offline
external usenet poster
 
Posts: 58
Default maximize one of three minimized workbooks to certain sheet

The range that gets pasted into the budget workbook is highlighted. I added
that code as the first line in the SaveAsOne sub and same results. Oh, let
me try to add it to the sub that starts the button. Maybe that is what you
meant.

"JRForm" wrote:

SLP,

What cell is active? Try putting this code right before the call to the
sheet button
Application.CutCopyMode = False

"SLP" wrote:

Did that and the sheet name is correct. It still won't activate the Buttons
sheet. BTW, I really appreciate all the help.

"JRForm" wrote:

SLP,

The code to call the sheet is correct. Try launching the macro recorder and
then select different sheets and make sure one of them is Buttons. Then look
at the code and verify the sheet name.

"SLP" wrote:

Oh, OK, thank you. The third sheet (ComparisonAndModify) is active. It is
the sheet where the BTITemp workbook (workbook 3) puts its data. I need my
end users back on the second sheet (Buttons) as they have two more steps to
do at this point.

"JRForm" wrote:

SLP,

I was sending you an example of multiple files and calling a workbook and
select a sheet. What sheet is selected when you return to the original book?
Also you do not need to make a Maximize call to the workbook. Just
acitivating the book will bring it up maximized.

"SLP" wrote:

Thanks, that almost does the trick. Sheet 2 (which is called Buttons)
doesn't activate. The SaveOneFile gets called from another sub which I
didn't send to you.

Your next response was out of synch with what I am doing but may come in
handy in a future project.

"JRForm" wrote:

SLP,

Put this statement at the top of your module below the "Option Explict"

Public Oldbook as string

Delete the Oldbook definition in your button code "Dim Oldbook as String"
Also change the code:
Windows("Oldbook.xls").Activate
To
Windows(Oldbook).Activate

That should do it, however, I don't see how/where the call is made for
"SaveOneFile" .


"SLP" wrote:

Thank you. This is the start of the button. We are in the budget workbook
and it calls up a workbook called link.

Dim Oldbook As String
Oldbook = ActiveWorkbook.Name

Windows("Link.xls").Activate
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AG1").Select
ActiveCell.FormulaR1C1 = "CC"
Range("AH1").Select
ActiveCell.FormulaR1C1 = "Location"
Range("AH2").Select
ActiveCell.FormulaR1C1 = "0"
Range("AH2").Select
Selection.NumberFormat = "0"

This is the end of the button. The Liink workbook has had a user defined
filter set and now gets saved with a different name.

Sub SaveOneFile()
'
ActiveWorkbook.SaveAs Filename:="H:\BITemp.xls", FileFormat:=xlExcel4, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False


ActiveWindow.WindowState = xlMinimized
Windows("Oldbook.xls").Activate
ActiveWindow.WindowState = xlMaximized

Sheets("Buttons").Select

"JRForm" wrote:

SLP,

Send me a code snippet maybe I can help if I can see what the code looks like.

"SLP" wrote:

Well, I guess I am just stupid. I can't get it to work. The budget workbook
has a button that opens another workbook (book 2) that has input boxes for
the user to select center and location for a filter, that data being placed
into book 3. Book 2 gets minimized. I want book 3 to be minimized and the
budget workbook to be maximized with sheet 2 being activated.

"SLP" wrote:

I'll try that. The workbook that has the macro button knows which workbook
is getting used. Don't think I ever made a public variable but will try.
Will keep you posted.

"JRForm" wrote:

SLP,

make it a Public variable.
set it equal to the workbook that you are trying to call up. I assume it is
the workbook the macro button is located. Does your code control what
workbook is getting used and then it will return to the one with the button?

"SLP" wrote:

Tried your suggestion and I can't make it work. I placed the variable at the
beginning of the code for that command button that starts this part of my
routine and then added the dim Oldbook as string at the beginning of the code
that minimizes the other workbook. Any other ideas? I'll keep at it....just
in case I need to add the variable someplace else.

"SLP" wrote:

That sounds interesting. I'll give it a try and let you know. Thanks.

"JRForm" wrote:

SLP,

Okaydo you have code that minimizes the workbooks? If so you can set a
variable to keep the workbook name.
dim Oldbook as string
Oldbook=activeworkbook.name


"SLP" wrote:

Thanks for the response. I thought about that but the problem is the
workbook used by many people who will save it with a different name. (Its a
budget tool.) Would a wildcard work for a file name? I could probably tell
everyone just to enter their initials or something after the workbook name.

"JRForm" wrote:

SLP,

Try
Windows("your workbook name").activate
sheets("Sheet2").select


"SLP" wrote:

Hi. Not sure if this can be done. At one point in my routing, I have three
workbooks that are minimized. I need to maximize one of the three and have
to open on sheet two. Anyone have any ideas on how to code this? Thanks in
advance.

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
minimized excel worksheet cannot drag or maximize ahinton Excel Discussion (Misc queries) 3 September 17th 08 02:52 PM
Need code to close minimized workbooks in BeforeClose event Cheryl Excel Programming 3 August 17th 07 10:53 PM
Why do minimized workbooks in Excell not show file names? george Excel Discussion (Misc queries) 1 May 26th 06 10:31 PM
Why do minimized workbooks in Excell not show file names? george Excel Discussion (Misc queries) 0 May 26th 06 09:25 PM
How to maximize workbooks (out of IE) tbk123 Excel Discussion (Misc queries) 3 March 15th 05 01:01 PM


All times are GMT +1. The time now is 10:46 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"