simple i am hoping with macros

C

chip_pyp

simple macro help. in my macro i have this line :
entry2 = InputBox("What kind of modem is it?")
If entry2 = "" Then entry2=

but i'm stuck on the last part. what i am trying to accomplish here is if
the user leaves the input box blank then entry2 will equal the vaule of the
cell in the row above it in the same column....for example-
user leaves input box blank so in c3 the value will be that of b3
 
J

jjanyan

if entry2 = "" then

cells(3,3).value = cells(2,3).value

end if

Is that what you're looking for?

It may have to be "sheets(1).cells(3,3).value =
sheets(1).cells(2,3).value"
replace "1" with whatever sheet number you're on.

Hope that helps. If it does, please rate my post. Thnx!
J
 
D

Debra Dalgleish

You can subtract one from the row number that you've calculated, and use
the entry in that row. Based on the macro you posted previously:

If entry2 = "" Then entry2 = Cells(nextrow - 1, 2).Value
 
Top