Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format sheet after importing a csv file

I get data in the form of a csv file and I need to change one field
that that looks like this:

Col C (for example)

MORNING/EST
AFTERNOON/PACIFIC
WEEKEND/MST

I would like to break the cells into 2 different col one for time
(morning/afternoon, etc) and one for time zone (est, pacific, mst)

So I guess I need to count over to the / then take the timezone info
and pass it through a series of case statements, est = estern, mst =
mountain, and then put that into a new colunm.

I need to make this available whenever I open the file and not have to
recreate the code everything I get a new file.

Thanks for any help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Format sheet after importing a csv file

Sub splitdate()

Columns("D:D").Insert

RowCount = 1
Do While Cells(RowCount, "C") < ""
slashpos = InStr(Cells(RowCount, "C"), "/")
If slashpos 0 Then
Cells(RowCount, "D") = _
Mid(Cells(RowCount, "C"), slashpos + 1)
Cells(RowCount, "C") = _
Left(Cells(RowCount, "C"), slashpos - 1)
End If
RowCount = RowCount + 1
Loop

End Sub



"CSINVA" wrote:

I get data in the form of a csv file and I need to change one field
that that looks like this:

Col C (for example)

MORNING/EST
AFTERNOON/PACIFIC
WEEKEND/MST

I would like to break the cells into 2 different col one for time
(morning/afternoon, etc) and one for time zone (est, pacific, mst)

So I guess I need to count over to the / then take the timezone info
and pass it through a series of case statements, est = estern, mst =
mountain, and then put that into a new colunm.

I need to make this available whenever I open the file and not have to
recreate the code everything I get a new file.

Thanks for any help


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
Importing an OpenOffice file in .ods ext (Excell format) jejpa New Users to Excel 2 March 28th 09 06:20 PM
importing txt file and wrong date format... MACRO vs MANUAL [email protected] Excel Programming 2 October 4th 06 09:15 AM
Convertion of Excel sheet file to .txt file format charu Excel Discussion (Misc queries) 2 June 27th 06 12:09 PM
How do I change the date format when importing a txt file? vpuckett Excel Worksheet Functions 2 November 28th 05 10:53 PM
importing another file format into Excel Leesa Excel Discussion (Misc queries) 1 May 13th 05 03:43 AM


All times are GMT +1. The time now is 12:16 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"