Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

Worksheet data entry form by Dave Peterson

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kev - 26 Jan 2007 02:10 GMT
Hi Dave,

First of all, a great thanks to you for helping me numerous times in
making my project a successful one.
I am about to wrap it already. Just one final favour, this is something
that i realized only after the presentation,
The code ensures that we must fill in all cells before submitting add
to database. But in my input sheet, there are several cells that can be
left blank. How do i modify the code to suit my needs?

   'cells to copy from Input sheet - some contain formulas
   myCopy =
"D5,D7,D9,D11,D13,D15,D17,D19,D21,D23,D25,D27,D29,D31,D33,D35,D37"

With inputWks
       Set myRng = .Range(myCopy)

       If Application.CountA(myRng) <> myRng.Cells.Count Then
           MsgBox "Please fill in all the cells!"
           Exit Sub
       End If
   End With

I am sure the answer lies in these two codings. The cells that can be
left blank are: D13,D15,D17,D19,D21,D23
I tried several ways but it only returned error in a way that all the
values entered after D23 is placed at D13 which was supposed to be
blank.

Pls help. Thanks a lot.
Really wish to settle this and close the project to a great weekend.
Dave Peterson - 26 Jan 2007 02:36 GMT
Declare another range variable that has to be filled in.

Dim AddrThatMustBeFilledIn as String
Dim RngThatMustBeFilledIn as range
...
AddrThatmustbefilledin = "d5,d7,whatevermoreyouneedhere"
...
then later...

set rngthatmustbefilledin = .range(addrthatmustbefilledin)

and then change that existing check with

If Application.CountA(Rngthatmustbefilledin) _
     <> rngthatmustbefilledin.Cells.Count Then

> Hi Dave,
>
[quoted text clipped - 27 lines]
> Pls help. Thanks a lot.
> Really wish to settle this and close the project to a great weekend.

Signature

Dave Peterson

kev - 26 Jan 2007 03:44 GMT
Thanks, it worked wonderfully.:)
Have a nice weekend.

> Declare another range variable that has to be filled in.
>
[quoted text clipped - 45 lines]
>
> Dave Peterson- Hide quoted text -- Show quoted text -

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.