PC Review


Reply
Thread Tools Rate Thread

Check that date exists

 
 
sailor4life61@yahoo.com
Guest
Posts: n/a
 
      29th Jun 2010
Hello
My code opens daily files on a (monthly basis) and pastes data into my
workbook. There should be at least one line of data for each day and
the date is in column A stating on row 3. I would like to have a
message via a popup box ("Data does not exist for mm/dd") if a day is
not represented in Column A. How can this be accomplished?

Also, I am using an input box as follows:

sMonth = InputBox("Please Enter Reporting Month")
sYear = InputBox("Please Enter Reporting Year")


With Sheets("Data")
.Range("B1").Value = sMonth
.Range("A1").Value = sYear
End With

This works, however I would like the month fomatted as MM and
currently is is formatted as M.

Thanks!
 
Reply With Quote
 
 
 
 
jodleren
Guest
Posts: n/a
 
      29th Jun 2010
On Jun 29, 6:20*pm, "sailor4lif...@yahoo.com"
<sailor4lif...@yahoo.com> wrote:
> Hello
> My code opens daily files on a (monthly basis) and pastes data into my
> workbook. *There should be at least one line of data for each day and
> the date is in column A stating on row 3. *I would like to have a
> message via a popup box ("Data does not exist for mm/dd") if a day is
> not represented in Column A. How can this be accomplished?


DateSerial could help you,but it is not that hard to wite it yourself
(I'd do that)

if year>year(now) or
(days<30 and month in [3...]

It is possible to have it all in one IF - just remember
every 4 year is a leap year
every 100 year is not
every 400 is

>
> Also, I am using an input box as follows:
>
> sMonth = InputBox("Please Enter Reporting Month")
> sYear = InputBox("Please Enter Reporting Year")
>
> * * With Sheets("Data")
> * *.Range("B1").Value = sMonth
> * *.Range("A1").Value = sYear
> * * End With


Why dont you create your own form? That would be easier and you can
add some control too?
Or use a calendar on that?


>
> This works, however I would like the month fomatted as MM and
> currently is is formatted as M.


check Cells.NumberFormat


>
> Thanks!


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check whether URL exists Greg Lovern Microsoft Excel Programming 1 15th Mar 2011 11:13 PM
check to see if a current date exists before creating a record Steve Microsoft Access 2 19th Jan 2009 03:16 AM
DSN, Check if exists Bernie Hunt Microsoft ADO .NET 2 10th Apr 2006 04:40 PM
Check url exists Pete Microsoft ASP .NET 1 29th Nov 2004 04:13 PM
check if url exists tom Microsoft Dot NET 1 11th Sep 2003 10:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:48 PM.