I have an error mentioned in the title. To me it looks ok especially when I debug.print it seems ok and opens that file as well.
[/CODE]![]()
Please Login or Register to view this content.
I have an error mentioned in the title. To me it looks ok especially when I debug.print it seems ok and opens that file as well.
[/CODE]![]()
Please Login or Register to view this content.
Perhaps because you are including the '*' character (which is not permitted in a file name) in the sDir variable ?
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Hi,
Since you imply the file name variable bit changes then you must use a variable and allocate the string of varying characters to the variable before you encounter the line of code. And since you seem to have both a preceding and succeeding variable string you first need to Dim two variables for the changing bit of the file name. e.g.
Then allocate the actual file name. e.g. supposing the characters for the file name variations are in cells A1 and A2 on Sheet1 then![]()
Please Login or Register to view this content.
Then your line of code will be![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
It did not work
Still says file not found.
I have declared string variable and singed value "*" to it and then used in the filename as suggested.
CODE]![]()
Please Login or Register to view this content.
pls how u do that im so lostpls helpHTML Code:
Administrative Note:
Welcome to the forum.
We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.
Please see Forum Rule #4 about hijacking and start a new thread for your query.
If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks