Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Text with Dates
in cell A1 i have some text. in cell B1 i have a date. how do I get Excel to display both the text and the date. I've tried: Dim olDate As Range Dim olText As Range Set olDate = Sheet1.Cells.Item(1,"A") Set olText = Sheet1.Cells.Item(1,"B") .Subject= olText +" - " + olDate I was hoping to get something like "text - 6/9/05" in the subject bar, but everytime I do this i get a run time error. i've tried replacing the date with text and it works just fine, and i've also tried just the date cell and it works fine. the problem comes up when i try and combine the date and text. both Any help would be much appreciated. Thank you in advance. -- littlegreenmen1 ------------------------------------------------------------------------ littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978 View this thread: http://www.excelforum.com/showthread...hreadid=379323 |
#2
|
|||
|
|||
Subject = Sheet1.Range("A1").Value & " - " &
Format(Sheet1.Range("B1").Value,"dd mmm yyyy") -- HTH Bob Phillips "littlegreenmen1" <littlegreenmen1.1qo86d_1118844311.6037@excelfor um-nospam.com wrote in message news:littlegreenmen1.1qo86d_1118844311.6037@excelf orum-nospam.com... in cell A1 i have some text. in cell B1 i have a date. how do I get Excel to display both the text and the date. I've tried: Dim olDate As Range Dim olText As Range Set olDate = Sheet1.Cells.Item(1,"A") Set olText = Sheet1.Cells.Item(1,"B") Subject= olText +" - " + olDate I was hoping to get something like "text - 6/9/05" in the subject bar, but everytime I do this i get a run time error. i've tried replacing the date with text and it works just fine, and i've also tried just the date cell and it works fine. the problem comes up when i try and combine the date and text. both Any help would be much appreciated. Thank you in advance. -- littlegreenmen1 ------------------------------------------------------------------------ littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978 View this thread: http://www.excelforum.com/showthread...hreadid=379323 |
#3
|
|||
|
|||
Maybe...
Subject= olText.value & " - " & olDate.text (I didn't test this.) littlegreenmen1 wrote: in cell A1 i have some text. in cell B1 i have a date. how do I get Excel to display both the text and the date. I've tried: Dim olDate As Range Dim olText As Range Set olDate = Sheet1.Cells.Item(1,"A") Set olText = Sheet1.Cells.Item(1,"B") Subject= olText +" - " + olDate I was hoping to get something like "text - 6/9/05" in the subject bar, but everytime I do this i get a run time error. i've tried replacing the date with text and it works just fine, and i've also tried just the date cell and it works fine. the problem comes up when i try and combine the date and text. both Any help would be much appreciated. Thank you in advance. -- littlegreenmen1 ------------------------------------------------------------------------ littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978 View this thread: http://www.excelforum.com/showthread...hreadid=379323 -- Dave Peterson |
#4
|
|||
|
|||
Thank y'all both very much. It works perfectly now. -- littlegreenmen1 ------------------------------------------------------------------------ littlegreenmen1's Profile: http://www.excelforum.com/member.php...o&userid=23978 View this thread: http://www.excelforum.com/showthread...hreadid=379323 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I convert dates to text keeping the format? | Excel Discussion (Misc queries) | |||
Converting Text months to sortable Numbers or Dates | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
COUNTIF With Multiple Dates, Columns and Text | Excel Worksheet Functions | |||
Convert text to dates | Excel Worksheet Functions |