Date Format

  • Thread starter Thread starter Greg Brow
  • Start date Start date
G

Greg Brow

I am writing a macro to save the name in cell A1 and I have a date Value in
cell B5

I am wanting excel to suggest for example greg 15 june 2005

here is the code so far but it wont save because it is coming up 16/6/2005

Suggestion = Range("A1").Value & Range("B5")

Thank in advance

Greg
 
Suggestion = Range("A1").Value _
& lcase(format(Range("B5").value,"dd mmmm yyyy"))
 
Just some added info:
If the cells look as you want, you could simplify that to

Range("Whatever").Value = Range("A1").Text & " " & Range("B5").Text
or
Range("Whatever").Value = Trim(Range("A1").Text) & " " & _
Trim(Range("B5").Text)


Text displays as the cell displays
Value displays what is actually stored in the cell.

If you want Dave's solution to return what you stated, you might want to add

Suggestion = trim(Range("A1").Value) & " " & _
& lcase(format(Range("B5").value,"dd mmmm yyyy"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top