#1   Report Post  
littlegreenmen1
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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   Report Post  
littlegreenmen1
 
Posts: n/a
Default


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert dates to text keeping the format? sprlarry Excel Discussion (Misc queries) 3 May 16th 05 06:06 AM
Converting Text months to sortable Numbers or Dates Greg Excel Discussion (Misc queries) 6 May 1st 05 03:32 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
COUNTIF With Multiple Dates, Columns and Text Shannon Excel Worksheet Functions 4 November 26th 04 11:12 PM
Convert text to dates Ket Excel Worksheet Functions 5 November 4th 04 08:03 PM


All times are GMT +1. The time now is 01:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"