This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi all,
I've just started learning vba and have a question that conventional google hasn't managed to help me with... I want to do an if statement which would look on a specified sheet in a different workbook.
The full filepath of the different workbook is: C:\BantersaurusRex\.....\DifferentWorkbook.xls
I have made a variable called WBTarget which is equal to the above directory.
My If formula looks like: If Workbooks(WBTarget).Sheets("Sheet1").Cells(r, Columns("C").Column).Value = [some criteria here]
I get a debug runtime error: 9 on the line above but can't figure out how to properly reference an external sheet within an if function...
Any help would be much appreciated!
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vba/comment...