Hi steveruston and welcome to ExcelForum,
I updated your code to show you how I would solve the problem. In addition I replaced your 'ActiveX' submit CommandButton, with a 'Forms' CommandButton. 'ActiveX' controls do not play well with others (can cause corruption) and Forms Controls are easier to work with.
You did a nice job for a first attempt. Try to modify the code to:
a. Add a Header to Sheet2
b. Do not allow update if an item is missing. Hint test using code like:
c. Test for items with invalid format (e.g. bad phone number)
See the following code in Module1 of your modified Workbook (attached):
To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. Dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx
Debugger Secrets:
a. Press 'F8' to single step (goes into subroutines and functions).
b. Press SHIFT 'F8' to single step OVER subroutines and functions.
c. Press CTRL 'F8' to stop at the line where the cursor is.
d. 'Left Click' the margin to the left of a line to set (or clear) a BREAKPOINT.
e. Press CTRL 'G' to open the IMMEDIATE WINDOW. 'debug.print' statements send their
output to the IMMEDIATE WINDOW.
f. Select View > Locals to see all variables while debugging.
g. To automatically set a BREAKPOINT at a certain location put in the line:
'Debug.Assert False'
h. To conditionally set a BREAKPOINT at a certain location put in lines similar to:
if i >= 20 and xTV20 > 99.56 then
Debug.Assert False
endif
i. A variable value will be displayed by putting the cursor over the variable name.
To manually set a breakpoint, see http://www.wiseowl.co.uk/blog/s196/breakpoints.htm
If you need additional help with this, upload your file and add to this thread.
Lewis
Bookmarks