Using Instr

keith0528

Active Member
Joined
Apr 23, 2009
Messages
250
Greetings All,

I'm trying to use instr to isolate the day part of a date

Dim BegDate As String
BegDate = Range("B3").Value
modBegDate = InStr(1, BegDate, ? )


the value in BegDate is "3/1/2014 3:35:09 PM" What I want to isolate is the day "01"

Question - the value in cell B3 is format type Custom. Does that make a difference?

thank you
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I would look for the "/" Instr(1, BegDate, "/") will return the position of the first "/".

Alternatly, have you considered Dimming BegDate as Date and using modBegDate = Day(BegDate)

If begDate has to be a string you could use modBegDate = Day(DateValue(BegDate))
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top