Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tony,
Rather than use wild cards, when you open a file (and before you do anything else) read the files name into a string variable and then navigate using that variable. This sould pick up any sequential digits and make your life much easier. "TONYC" wrote: I have devised a long macro (only a small part shown below) which extractes data from a file called 'Risk Question.xls.' when completed and returned to me via Microsoft outlook. However, since its creation I have aquired Windows XP, which I understand adds a sequential digit after the file name when opened (ie Risk Question1.xls), when opening several files woith the same name one after the other. (Even thought I ensure I close the active file beofre openeing the new file.) My quesion is could I use a wild card (eg 'Risk Question[b]*.xls') to extract data from these files. I havent changed the macro as its very long and wanted advise first. Name Windows("Risk Question.xls").Activate Range("C5:E5").Select Application.CutCopyMode = False Selection.Copy Windows("Risk Register.xls").Activate Range("C" & nextlineno).Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Regards Tony -- TONYC ------------------------------------------------------------------------ TONYC's Profile: http://www.excelforum.com/member.php...o&userid=12468 View this thread: http://www.excelforum.com/showthread...hreadid=261967 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I use wildcards in IF statements and Macros | Excel Discussion (Misc queries) | |||
Wildcards and if | Excel Worksheet Functions | |||
use of wildcards | Excel Worksheet Functions | |||
Use wildcards | Excel Discussion (Misc queries) | |||
wildcards in vba | Excel Discussion (Misc queries) |