Re: $$Excel-Macros$$ Convert number of days to month and day (ie, 035 = 2/4)

2013-08-08 Thread Don Barton
Thanks Sam,
I left out one little fact.  This is for VBA.  I tried the code in my 
module, but it got confused.  In some cases ws code and vba are similar, 
but for DATE function, they are very different!  I am sure there is a 
functional equivalent.  I am also posting the VBA I've written thus far.
The goal is to change what the barcode scanner reads into Excel to a easier 
visual format.

What the barcode scanner reads into Excel: &>0131502359 What we want to 
see after running the VBA: 5/30/2013

I test for then remove the first three characters if equal to "&>0"
Then remove the last 4 digits (this is a time and we don't it)
This leaves 13150 in the string
I want to convert 150 to MM/DD
Then take the 13 and concatenate to "20" to make 2013 and rearrange the 
pieces back together as mm/dd/2013
I think I can figure the rest out, but the mm/dd from days of the year has 
me challenged.

 For Each Dtx In Range("D2:" & Cells(Range("D:D").Rows.Count, 
3).End(xlUp).Address)
If Left(Dtx, 3) = "<&0" Then
Dtx.Value = Replace(Left(Dtx, Len(Dtx) - 4), "<&0", "")
NDate = Mid(D2, 3, 3)
'MDDate = take number of days and convert to mm/dd
'Code to rearrange the pieces back together
Else
Dtx.Value = ""
End If
Next
End Sub

Thanks,
Don
 

On Wednesday, August 7, 2013 7:20:15 PM UTC-6, Sam Mathai Chacko wrote:
>
> Don, try passing the number of days to the date function like this.
>
> =TEXT(DATE(2013,1,No. Of Days - 1), "m\/d")
>
> Sam MATHAI CHACKO 
> On Aug 8, 2013 4:11 AM, "Don Barton" > 
> wrote:
>
>> Greetings, 
>> I work at a hospital laboratory and we have an expiration date barcode on 
>> blood transfusion units that formats the month and day as a number; the 
>> number of days since the beginning of the year.  We use a barcode scanner 
>> to read in the expiration date, but need to convert the number of days to 
>> month and day.  For example for this year (2013), 015 Would be 1/15, 275 
>> would be 10/2.  The expiration date includes year and time as well, but I 
>> can pull out the numbers of days using the MID function.  
>> I've looked through several websites as well as this Group, but haven't 
>> found any solutions yet.
>>
>> Thanks,
>>
>> Don
>>
>>  -- 
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>> https://www.facebook.com/discussexcel
>>  
>> FORUM RULES
>>  
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please 
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security 
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>  
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and 
>> members are not responsible for any loss.
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to excel-macros...@googlegroups.com .
>> To post to this group, send email to excel-...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.




Re: $$Excel-Macros$$ Convert number of days to month and day (ie, 035 = 2/4)

2013-08-07 Thread Sam Mathai Chacko
In fact you probably don't need that - 1. Remove it. I'm just typing this
on my handset, so please don't mind.
On Aug 8, 2013 6:50 AM, "Sam Mathai Chacko"  wrote:

> Don, try passing the number of days to the date function like this.
>
> =TEXT(DATE(2013,1,No. Of Days - 1), "m\/d")
>
> Sam MATHAI CHACKO
> On Aug 8, 2013 4:11 AM, "Don Barton"  wrote:
>
>> Greetings,
>> I work at a hospital laboratory and we have an expiration date barcode on
>> blood transfusion units that formats the month and day as a number; the
>> number of days since the beginning of the year.  We use a barcode scanner
>> to read in the expiration date, but need to convert the number of days to
>> month and day.  For example for this year (2013), 015 Would be 1/15, 275
>> would be 10/2.  The expiration date includes year and time as well, but I
>> can pull out the numbers of days using the MID function.
>> I've looked through several websites as well as this Group, but haven't
>> found any solutions yet.
>>
>> Thanks,
>>
>> Don
>>
>>  --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.




Re: $$Excel-Macros$$ Convert number of days to month and day (ie, 035 = 2/4)

2013-08-07 Thread Sam Mathai Chacko
Don, try passing the number of days to the date function like this.

=TEXT(DATE(2013,1,No. Of Days - 1), "m\/d")

Sam MATHAI CHACKO
On Aug 8, 2013 4:11 AM, "Don Barton"  wrote:

> Greetings,
> I work at a hospital laboratory and we have an expiration date barcode on
> blood transfusion units that formats the month and day as a number; the
> number of days since the beginning of the year.  We use a barcode scanner
> to read in the expiration date, but need to convert the number of days to
> month and day.  For example for this year (2013), 015 Would be 1/15, 275
> would be 10/2.  The expiration date includes year and time as well, but I
> can pull out the numbers of days using the MID function.
> I've looked through several websites as well as this Group, but haven't
> found any solutions yet.
>
> Thanks,
>
> Don
>
>  --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.




$$Excel-Macros$$ Convert number of days to month and day (ie, 035 = 2/4)

2013-08-07 Thread Don Barton
Greetings, 
I work at a hospital laboratory and we have an expiration date barcode on 
blood transfusion units that formats the month and day as a number; the 
number of days since the beginning of the year.  We use a barcode scanner 
to read in the expiration date, but need to convert the number of days to 
month and day.  For example for this year (2013), 015 Would be 1/15, 275 
would be 10/2.  The expiration date includes year and time as well, but I 
can pull out the numbers of days using the MID function.  
I've looked through several websites as well as this Group, but haven't 
found any solutions yet.

Thanks,

Don

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.