Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Please help me to adapt this code.

My aim is to have a form and on that page be able to
click a button, have the form enter the data on the
datasheet. If one text box is empty it will not write a
blank over an existing value.

I have been using the code below and it only allows me to
write over the existing cells value.

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

I have tried to adapt it and I get 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?
Also where do I start a message box sayaing

"Cell "A1" already has a value of 3.22, would you like to
replace with 2.66?. Click Yes to Replace, No to skip.
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Please help me to adapt this code.

why not use
if sh.range("D8").value = "" then
instead of
sh.range("d8") is null then
where exactly do you hit the error?

"Rob Hargreaves" wrote:

My aim is to have a form and on that page be able to
click a button, have the form enter the data on the
datasheet. If one text box is empty it will not write a
blank over an existing value.

I have been using the code below and it only allows me to
write over the existing cells value.

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

I have tried to adapt it and I get 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?
Also where do I start a message box sayaing

"Cell "A1" already has a value of 3.22, would you like to
replace with 2.66?. Click Yes to Replace, No to skip.

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
adapt macro monty Excel Worksheet Functions 3 March 9th 05 12:44 PM
How can I adapt the included filter example to search for more th. Cheryl Excel Discussion (Misc queries) 0 February 24th 05 08:29 PM
Trying to adapt progress meter hotherps[_144_] Excel Programming 0 October 17th 04 02:46 PM
Required sum, need values to adapt with changes wjsubs Excel Programming 0 June 24th 04 08:30 PM
Adapt an array routine or a better way? Stuart[_5_] Excel Programming 2 July 14th 03 08:35 PM


All times are GMT +1. The time now is 10:02 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"