Hi, I'm running a VBA script from a 'dummy' excel file to convert a txt file into a csv with a specific format. >From the 'dummy' excel several operations are performed as, open txt, add week numbers, create pivot table etc. All operations are performed in the openned txt.
One essential thing is to create a column G, which contains the date of the monday of the week specified in column F (week) and E (month). To see which date is actually the monday of that week in that year I'm using John Green's code: (http://www.cpearson.com/excel/ DateTimeVBA.htm). Adding the value to the cell the folowing way: Range("G2").Select Selection.NumberFormat = "m/d/yyyy" ActiveCell.FormulaR1C1 = "=WeekStart(RC[-2], RC[-1])" Now the thing is: I cannot run this code (WeekStart) from the just opened txt, I think because the code is not in the txt, but in the dummy excel. WeekStart is a public function. How can I make this work, without needing to copy all data into the dummy file. Thanks, Maarten --~--~---------~--~----~------------~-------~--~----~ ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 5,200 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -~----------~----~----~----~------~----~------~--~---