scotttiger
New Member
- Joined
- Jul 21, 2014
- Messages
- 6
I want to have a find and replace macro for a spreadsheet that uses vlookup to get a file for a particular month
The vlookup function will have a network path like
For every month I need to find and replace the current month (Jun 14) with the next month's spreadsheet (Jul 14)
but if it hasn't been created yet I would like it to be skipped over/ keep the same month.
Any website/guide/code would be great... I'm a complete newby to VB, so far I've tried to look at tutorials on how write the find and replace portion of the code
but the obstacle is knowing if a file exists or does not exist...
If my end product can follow this scheme that would be awesome... or letting me know if this is possible or not possible for Microsoft Excel 2007 :
in each cell of Col A do this
if (C://.../.../.../[spreadsheet.xls]Jul '14 EXISTS)
replace Jun with Jul
else
replace Jun with Jun/ skip / do nothing
Sorry for the lengthy post thanks for reading!
The vlookup function will have a network path like
VLOOKUP("% Return - Month",'C:\DATA\ Spreadsheets\[a_spreadsheet.xls]Jun 14'!$R$5:$T$37,3,0)*100
For every month I need to find and replace the current month (Jun 14) with the next month's spreadsheet (Jul 14)
but if it hasn't been created yet I would like it to be skipped over/ keep the same month.
Any website/guide/code would be great... I'm a complete newby to VB, so far I've tried to look at tutorials on how write the find and replace portion of the code
but the obstacle is knowing if a file exists or does not exist...
If my end product can follow this scheme that would be awesome... or letting me know if this is possible or not possible for Microsoft Excel 2007 :
in each cell of Col A do this
if (C://.../.../.../[spreadsheet.xls]Jul '14 EXISTS)
replace Jun with Jul
else
replace Jun with Jun/ skip / do nothing
Sorry for the lengthy post thanks for reading!