Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
label caption | Excel Discussion (Misc queries) | |||
picture in caption?? | Excel Discussion (Misc queries) | |||
Caption | Excel Programming | |||
CommandButton.Caption | Excel Programming | |||
label caption | Excel Programming |