I have a spreadsheet with a single column range, "UserInput," in A1...A40. I have a second single column range of equal dimensions called "DefaultValue" in D1...D40.
Whenever the value in a UserInput cell is blank, I want code created in the VBA "Worksheet_Change(ByVal Target As Range)" procedure to copy the associated DefaultValue into that cell. If the user deletes everything in A35 for example, the cell is given the value in D35.
This setup provides the user with a default value in each UserInput cell and allows him to edit that value. If he makes a mess of it he can simply delete what he did and the VBA code will automatically reassert the associated DefaultValue so he can start again.
I've been unable to create looping code that provides this service ('for each cell in ... do, or with each, etc.) I know how to code these loops generically, but I'm lost in a sea of parentheses and dots in VBA 2007. Help appreciated - just a sample code block would probably do it for me.
Jim
Bookmarks