Norah
Sep 10th, 2004, 11:52 AM
I use VB for Excel with no problems except these two:
1. I need to copy in a given Excel file a sheet named, say "one", into a sheet named, say "two".Suppose the sheet "one"has columns A and B. I use the following code:
Do while n>=1 and sheet.application. worksheets("one").range("A"&n)<>""
sheet.application.worksheets("two").range(A&n).value=sheet.application.worksheets("one").range("A"&n)
sheet.application.worksheets("two").range(B&n).value=sheet.application.worksheets("one").range("B"&n)
n=n+1
loop
This some times works and some times doesn't. Is there a better way?
2. As the running of my codes takes quite a lot of time, it would be convenient for me to pause at some time and resume later on.
How can I do this?
1. I need to copy in a given Excel file a sheet named, say "one", into a sheet named, say "two".Suppose the sheet "one"has columns A and B. I use the following code:
Do while n>=1 and sheet.application. worksheets("one").range("A"&n)<>""
sheet.application.worksheets("two").range(A&n).value=sheet.application.worksheets("one").range("A"&n)
sheet.application.worksheets("two").range(B&n).value=sheet.application.worksheets("one").range("B"&n)
n=n+1
loop
This some times works and some times doesn't. Is there a better way?
2. As the running of my codes takes quite a lot of time, it would be convenient for me to pause at some time and resume later on.
How can I do this?