Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Is there a difference in VB script from Excel 2000 to 2003?

I have an electronic timesheet that was created in Excel 2000. There are approximately 26 rows in which people can enter their time for various jobs that they work on. In Excel 2000, once they enter time on the last row, the timesheet automatically adds one more row. In Excel 2003, instead of adding another row, it returns an error. When you debug the error, it goes to the spot in the script listed below. In the debugger, the last row of this text is highlighted in yellow.

I'm not a programmer by nature, but if anyone could tell me if these commands changed any in 2003, I would appreciate it. Thanks.

Public Sub AppendNormalTimesheetRow()

Dim targetRow As Integer

targetRow = getSubtotalRow()

'Insert a blank row above subtotal.

Sheets("TimeSheet").Range("A" & targetRow).EntireRow.Insert

3 Answers

Relevance
  • Tim
    Lv 4
    1 decade ago
    Favorite Answer

    So, you just want to add a row to the time sheet and have your totals include the new data, right?

    I don't know why that code doesn't work (if it worked in 2000, it should still work in 2003 in most cases). However, you really no longer need the code if everybody is using Excel 2003 or 2007.

    Instead, you can use Lists (now called Tables in Excel 2007). Select your time sheet range, including all headers and columns, but do not select the subtotal row. Now, go to Data --> List and choose Create List.

    Now, when you have finished filling in a row, Excel will automatically add a new row and apply the formatting and any formulas from the rest of the table. There are many other advantages to lists as well, especially if you are charting data.

    I encourage you to create a copy of your worksheet (don't do this on the original until you are comfortable with it), delete the code, and then try the List method.

    Tim

    http://www.tvmcalcs.com/

  • cuccia
    Lv 4
    5 years ago

    though Microsoft excel 2003 is way a lot less annoying to stay with and learn, Microsoft excel 2007 is extra better and extra developed by using very reality of it may provide sensible and sensible equipment and it has new useful factors that you are able to apply to verify, percentage and cope along with your files truly.

  • inin
    Lv 6
    1 decade ago

    getSubtotalRow is a user created function, make sure the excel file contains that function.

Still have questions? Get your answers by asking now.