0

I currently have my own vba to take data from some website, I also imposed some codes to do analytical stuff.

The thing is that I would like to save the analytical results in a new sheet every time I run the macro.

How should I deal with the code?

  • https://stackoverflow.com/questions/20697706/how-to-add-a-named-sheet-at-the-end-of-all-excel-sheets – Vityata Jul 19 '17 at 09:32
  • thanks@Vityata , But I would like to save the analytical stuff every time I run the macro. For example, I run the codes for 3 times, then I would like to have 3 sheets saving my previous analytical stuff – HKU_Johnny_QFin Jul 19 '17 at 09:36

1 Answers1

0

You could just start adding this to your code, which generate a new tab and call it with "R_" and the current date/time:

Sheets.Add.Name = ActiveSheet.Name = "R_" & Format(Date, "ddmmyy") & "_" & Format(Time, "hhmmss") 

then you have to edit your code and print all results in this sheet. It is really hard to help you in this second part, because you didn't show us the code you're using.

Nicolaesse
  • 2,554
  • 12
  • 46
  • 71
  • thank you very much for your help. Actually, every time when I run the macro, there would be a sheet coming out. If I do not save the sheet, I run the macro again, then the results would show in the same sheet covering previous results. I would like to save the result to a new sheet every time I run the code, – HKU_Johnny_QFin Jul 19 '17 at 10:22