Text in VBA

J

Jeff

Hello,

I'd like, if possible, in VBA to have an inputbox that will allow me to
write a text in J1 if B1 has value but J1 is empty.
Is that possible?
 
F

Frank Kabel

Hi
but THEN should this happen:
- do you want to click a button
- should it appear after entering something in B1
 
J

Jeff

Hi,

Yes. I want to click on button and it should appear after entering something
in B1
Regards,
 
F

Frank Kabel

Hi
try the following macro (assign it to a button):
sub foo()
dim res
with activesheet
if .range("B1").value<>"" and .range("J1").value = "" then
res = inputbox("Enter data for J1")
.range("J1").value=res
end with
end sub
 
Top