Hi
I am trying to create a macro which does mutiple things and i am having trouble with it and i was wondering if anyone can help me?
I have currently got a the macro in the notepad document i have attachted.
However i need to change this so instead of looping for that strFile variable it loops through the following file names:
Graphing_MTH_Actual_Curr_Year" & "*.csv
Graphing_MTH_Actual_Prev_Year" & "*.csv
Graphing_YTD_Actual_Curr_Year" & "*.csv
Graphing_YTD_Actual_Prev_Year" & "*.csv
Graphing_R12_Actual_Curr_Year" & "*.csv
Graphing_R12_Actual_Prev_Year" & "*.csv
But i also need to change it so instead of just pasting it into the MTH sheet it pastes it in different sheets depending on the file name. So:
- If the filename is Graphing_MTH_Actual_Curr_Year" & "*.csv it pastes the data in MTH
- If the filename is Graphing_MTH_Actual_Prev_Year" & "*.csv it pastes the data in MTHPrevious
- If the filename is Graphing_YTD_Actual_Curr_Year" & "*.csv it pastes the data in YTD
- If the filename is Graphing_YTD_Actual_Prev_Year" & "*.csv it pastes the data in YTDPrevious
- If the filename is Graphing_R12_Actual_Curr_Year" & "*.csv it pastes the data in R12
- If the filename is Graphing_R12_Actual_Prev_Year" & "*.csv it pastes the data in R12Previous
I hope this makes sense. I am having really trouble with this as i have got it to loop through the strFldr and lookup strFile and copy and paste the correct data into the MTH tab but i can not work out how to get it to loop through multiple factors. I have thought about using select case statements and loops within loops but i am not sure how either of them work.
Can anyone help me?
Thanks
Jeskit
Bookmarks