Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to reference win.caption, when caption changes


I have a macro that looks for a window name with win.Caption = "..."
The problem I'm facing is that the window caption changes slightly
every day. Is there a way to only reference the last x characters of
the caption, or allow wildcards in the middle? Thanks


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=530901

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to reference win.caption, when caption changes

without having seen your code, I would refer you to VBA help on LIKE and INSTR

--
Regards,
Tom Ogilvy


"Paul987" wrote:


I have a macro that looks for a window name with win.Caption = "..."
The problem I'm facing is that the window caption changes slightly
every day. Is there a way to only reference the last x characters of
the caption, or allow wildcards in the middle? Thanks


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=530901


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default How to reference win.caption, when caption changes

You could use Right, Left or Mid functions to grab bits. Perhaps more
flexibly, use InStr, e.g.

If InStr(win.Caption, "xxx") < 0 Then ...

"Paul987" wrote:


I have a macro that looks for a window name with win.Caption = "..."
The problem I'm facing is that the window caption changes slightly
every day. Is there a way to only reference the last x characters of
the caption, or allow wildcards in the middle? Thanks


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=530901


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to reference win.caption, when caption changes


thanks guys. Martin - I used your advice, it worked well.
I'm don't know how to write VBA, but I seem to be able to piece thing
together, like in this instance. Thank

--
Paul98
-----------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...fo&userid=2485
View this thread: http://www.excelforum.com/showthread.php?threadid=53090

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
label caption gramps Excel Discussion (Misc queries) 0 November 1st 07 03:56 PM
picture in caption?? RUSTYDK85 Excel Discussion (Misc queries) 1 May 10th 05 07:25 AM
Caption No Name Excel Programming 2 September 23rd 04 01:27 PM
CommandButton.Caption Bob Phillips[_5_] Excel Programming 0 September 8th 03 08:15 AM
label caption Rod Taylor Excel Programming 2 July 31st 03 03:25 AM


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