Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 407
Default Date Problems

Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in cell
c5 and go down as far as c4000 and remove the space in front of each entry.
Can someone tell me how to write that macro?

Thanks much!
Dean


  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default Date Problems

Hi Dean,

No need for macro I guess. Just select the column (range) which contains the
"dates", format it as date (just in case), go to menu EditReplace, in the
'Find what' box type a space, leave the 'Replace with' box blank, press
'Replace All'

Regards,
KL


"Dean" wrote in message
...
Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in
cell c5 and go down as far as c4000 and remove the space in front of each
entry. Can someone tell me how to write that macro?

Thanks much!
Dean



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Date Problems

hi,
you could use this macro...it assumes that the blank space is after the
date...if it is before, you could use the right(..) function instead of the
left(..) function.

Sub correctDate()
Dim range_cell As Range
For Each range_cell In ActiveSheet.Range("c15:c4000")
range_cell.Value = Left(range_cell.Value, Len(range_cell.Value) - 1)
Next range_cell
End Sub

hope it helps

MPG

"Dean" wrote in message
...
Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in
cell c5 and go down as far as c4000 and remove the space in front of each
entry. Can someone tell me how to write that macro?

Thanks much!
Dean



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Date Problems

Hi Dean,
You don't need a macro! Supposing your dates with leading spaces are in
column A, just put a =trim(A1) function in a new column formatted to a
desired date format, and fill it down to the last row as necessary.
Regards,
Stefi


€˛Dean€¯ ezt Ć*rta:

Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in cell
c5 and go down as far as c4000 and remove the space in front of each entry.
Can someone tell me how to write that macro?

Thanks much!
Dean



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Date Problems

you could also do this:
select the entire column
click data and then text to columns
choose delimited
click next
put a check next to space under delimiters
click next and then finish

it will put the dates in the next column to the right. if you have data
there now, just insert a column to the right of the original "date" field

--


Gary


"Dean" wrote in message
...
Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in
cell c5 and go down as far as c4000 and remove the space in front of each
entry. Can someone tell me how to write that macro?

Thanks much!
Dean





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Date Problems

Clever! This is the best solution, it makes the trick in situ without using
an extra column!
Stefi

€˛KL€¯ ezt Ć*rta:

Hi Dean,

No need for macro I guess. Just select the column (range) which contains the
"dates", format it as date (just in case), go to menu EditReplace, in the
'Find what' box type a space, leave the 'Replace with' box blank, press
'Replace All'

Regards,
KL


"Dean" wrote in message
...
Someone has sent me a huge spreadsheet with a column full of dates. Well,
not really, each date has a blank space in front of it, so I guess even
though it may say 02/23/2004, it is really just a label.

I need to have the dates so I can subtract them from one another, etc.

I would like to have a macro that can go down the column (say start in
cell c5 and go down as far as c4000 and remove the space in front of each
entry. Can someone tell me how to write that macro?

Thanks much!
Dean




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
Date problems Gerry[_2_] Setting up and Configuration of Excel 1 September 28th 07 12:42 PM
date problems piute Excel Discussion (Misc queries) 14 December 7th 06 03:22 PM
Date problems, is it a bug??? R-P Excel Discussion (Misc queries) 4 August 18th 06 03:40 PM
Date problems MrEMann Excel Worksheet Functions 4 August 25th 05 04:42 PM
Date Problems MikePiehl Charts and Charting in Excel 2 June 2nd 05 05:45 PM


All times are GMT +1. The time now is 04:46 PM.

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"