Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 17
Default messagebox problem

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To show a messagebox pol Excel Discussion (Misc queries) 3 July 17th 09 01:05 PM
MessageBox with tick box Sophie Excel Discussion (Misc queries) 3 February 5th 09 02:32 PM
Printing messagebox nc Excel Discussion (Misc queries) 1 March 22nd 05 02:49 PM
Working around a messagebox JustinR Excel Programming 1 May 26th 04 01:53 AM
another messagebox/form question Bob Phillips[_5_] Excel Programming 0 August 6th 03 06:40 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"