View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default messagebox problem

Dim Resp as long
....your declares
set rng = ....

resp = vbyes
if rng.value < "" then
resp = msgbox("Overwrite " & rng.address(0,0) & ". It contains: " _
& rng.value, buttons:=vbyesno)
end if
if resp = vbyes then
rng.value = sh.Range("D8").Text
else
msgbox "come back later..."
end if



Sam wrote:

Hi,

I would like to be able to have my userform give back the
information message if there is already a value in the
destination saying -

"A2 already has a value! would you like
to replace " + x " with " y "?"

my code looks like this

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

Thank you for your help


--

Dave Peterson