View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
leerem leerem is offline
external usenet poster
 
Posts: 88
Default How can I reduce repetative code

i have set up a userform with OptionButton for all the weeks of the year to
save data too, with a command Button with If OptionButton1=true then -and
code-
Instead of having to repeat the same steps over and over again eg: open new
workbook / name new workbook / copy data to new workbook /save workbook /
close workbook. My question: Can I set up a variable for week Number and
associate that into the file name, therby saveing approx 40 lines of code for
each week no.