Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default use only part of window name in a macro

How would you use only part of the window name in a macro, the dates will
change so I only need to use Time Sheet For



Windows("Time Sheet For 09.18.2008 To 10.01.2008.xls").Activate




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default use only part of window name in a macro

You could do something like this

Dim myWB As Excel.Workbook
For Each myWB In Application.Workbooks
If myWB.Name Like "Time Sheet For*" Then
Windows(myWB.Name).Activate
Exit For
End If
Next myWB

--
HTH,
Barb Reinhardt




"Paul B" wrote:

How would you use only part of the window name in a macro, the dates will
change so I only need to use Time Sheet For



Windows("Time Sheet For 09.18.2008 To 10.01.2008.xls").Activate





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default use only part of window name in a macro

What are you trying to do? Maybe if you state what your goal is, we
can assist you better.

--JP

On Sep 22, 4:05*pm, "Paul B" wrote:
How would you use only part of the window name in a macro, the dates will
change so I only need to use Time Sheet *For

Windows("Time Sheet *For 09.18.2008 To 10.01.2008.xls").Activate


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default use only part of window name in a macro

I am just wanting to arrange some windows like below, but the time sheet one
will change names

Windows.Arrange ArrangeStyle:=xlHorizontal
Windows("FF Time").Activate
With ActiveWindow
.Width = 765
.Height = 232.5
End With
ActiveWindow.SmallScroll Down:=2

Windows("Time Sheet For 09.18.2008 To 10.01.2008.xls").Activate
With ActiveWindow
.Width = 765
.Height = 255
End With
With ActiveWindow
.Top = 260.5
.Left = 0.25
End With



"JP" wrote in message
...
What are you trying to do? Maybe if you state what your goal is, we
can assist you better.

--JP

On Sep 22, 4:05 pm, "Paul B" wrote:
How would you use only part of the window name in a macro, the dates will
change so I only need to use Time Sheet For

Windows("Time Sheet For 09.18.2008 To 10.01.2008.xls").Activate



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default use only part of window name in a macro

Just assign the changing filename part to a string variable. Then you
can change the variable without hard-coding the dates (and potentially
having to change it every two weeks).


Dim strDate As String

strDate = "09.18.2008 To 10.01.2008"

Windows("Time Sheet For " & strDate & ".xls").Activate


--JP

On Sep 23, 8:31*am, "Paul B" wrote:
I am just wanting to arrange some windows like below, but the time sheet one
will change names

Windows.Arrange ArrangeStyle:=xlHorizontal
* * Windows("FF Time").Activate
* * With ActiveWindow
* * * * .Width = 765
* * * * .Height = 232.5
* * End With
* * ActiveWindow.SmallScroll Down:=2

Windows("Time Sheet *For 09.18.2008 To 10.01.2008.xls").Activate
* * With ActiveWindow
* * * * .Width = 765
* * * * .Height = 255
* * End With
* * * * With ActiveWindow
* * * * .Top = 260.5
* * * * .Left = 0.25
* * End With

"JP" wrote in message

...
What are you trying to do? Maybe if you state what your goal is, we
can assist you better.

--JP

On Sep 22, 4:05 pm, "Paul B" wrote:



How would you use only part of the window name in a macro, the dates will
change so I only need to use Time Sheet For


Windows("Time Sheet For 09.18.2008 To 10.01.2008.xls").Activate- Hide quoted text -


- Show quoted text -


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
help with part of my macro James Excel Programming 3 March 12th 08 03:41 PM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
Replace Old Part Numbers with New Part Numbers in a Macro. Jeffery Keown Excel Discussion (Misc queries) 5 October 17th 06 03:45 PM
Run only part of a macro for testing Josh O. Excel Programming 4 May 19th 05 04:49 PM
Lookup as Part of Macro Ken[_18_] Excel Programming 1 June 11th 04 12:51 AM


All times are GMT +1. The time now is 05:07 PM.

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"