ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Form writing blanks! (https://www.excelbanter.com/excel-programming/322163-form-writing-blanks.html)

Form problem!

Form writing blanks!
 
I have a form and it keeps on overwriting values with
blanks if nothing is entered.

I would like to stop this if the textbox on the form is
blank then do not try to write anything at all whether
destination cell is blank or already has a value.

Also if there is some information already there is it
possible to get a message box for each textbox stating "A
already has a value! would you like to replace x with y?"

This would be great if I can. Anyone know how?

Thank you!

Himszy[_2_]

Form writing blanks!
 
Why not add a If function saying that if the textbox is empty then do
nothing and if it contains something overwrite?
I would add something along the lines of
message = "A already has a value! would you like to replace " + x " with "
y "?"
then
msgbox message.

Hope this helps
Michael

"Form problem!" wrote in message
...
I have a form and it keeps on overwriting values with
blanks if nothing is entered.

I would like to stop this if the textbox on the form is
blank then do not try to write anything at all whether
destination cell is blank or already has a value.

Also if there is some information already there is it
possible to get a message box for each textbox stating "A
already has a value! would you like to replace x with y?"

This would be great if I can. Anyone know how?

Thank you!




No Name

Form writing blanks!
 
I have been writing my code like this -

Set Rng = shData.Range("I" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

but now have tried it like this as you said to but it
gives me an error.

If sh.Range("D8") Is Null Then
End
Else
Set Rng = shData.Range("E" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text
End If

What do I need to add? And how do you set up a msgbox
replace x with y.

Thanks



Himszy[_2_]

Form writing blanks!
 

wrote in message
...
I have been writing my code like this -

Set Rng = shData.Range("I" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text

but now have tried it like this as you said to but it
gives me an error.

If sh.Range("D8") Is Null Then
End
Else
Set Rng = shData.Range("E" & Application.Match(CLng
(sh.Range("D6")), shData.Range("B:B"), 0))
Rng.Value = sh.Range("D8").Text
End If

What do I need to add? And how do you set up a msgbox
replace x with y.

Thanks


Hi, i'm only a noob, ask one of these boffins :-)




All times are GMT +1. The time now is 09:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com