Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Change cell data using excel 2003

Hello,

I have 100 worksheets with 3 columns of data and 1 row to 500 rows. In
column C my data looks like so
125
252
CO125
CO314
MECH
MECH2

This is my question -
How can I change my data in the cells with CO125 or CO314 to look like
this 125CO or 314CO?

I've searched for code to help me but I've been unsuccessful! Please
Help!

Thank you for help,
jfcby

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 268
Default Change cell data using excel 2003

The easiest would be a formula in a helper column
With your number in say A1, then in B1 ente
=IF(LEFT(A1,2)="CO",RIGHT(A1,LEN(A1)-2)&LEFT(A1,2),IF(LEFT(A1,4)="MECH",RIGHT(A1,LEN(A1 )-4)&LEFT(A1,4),A1))
Copy down.

Else you ned to write a macro with a for next loop

"jfcby" wrote:

Hello,

I have 100 worksheets with 3 columns of data and 1 row to 500 rows. In
column C my data looks like so
125
252
CO125
CO314
MECH
MECH2

This is my question -
How can I change my data in the cells with CO125 or CO314 to look like
this 125CO or 314CO?

I've searched for code to help me but I've been unsuccessful! Please
Help!

Thank you for help,
jfcby


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Change cell data using excel 2003

Try:

Sub TestData()
Dim MyCell As Range
For Each MyCell In Selection
If Left(MyCell.Value, 2) = "CO" Then
MyCell.Value = Right(MyCell.Value, Len(MyCell.Value) - 2) & "CO"
End If
Next
End Sub

Alan

jfcby wrote:
Hello,

I have 100 worksheets with 3 columns of data and 1 row to 500 rows. In
column C my data looks like so
125
252
CO125
CO314
MECH
MECH2

This is my question -
How can I change my data in the cells with CO125 or CO314 to look like
this 125CO or 314CO?

I've searched for code to help me but I've been unsuccessful! Please
Help!

Thank you for help,
jfcby


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
Excel 2003 make 1 date cell automatically change another date cell Scotty Excel Worksheet Functions 4 April 22nd 10 09:01 AM
how to change data from horizontal to be vertical (Excel 2003) Suwat Upathambhakul (Thailand) Excel Discussion (Misc queries) 3 April 14th 09 08:11 AM
I want to change the colour of the cell cursor in Excel 2003. Alphalacey Excel Discussion (Misc queries) 1 January 21st 09 05:55 AM
How do I change the order of the data in a pie chart - excel 2003 carincamille Charts and Charting in Excel 1 February 12th 07 07:35 PM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 Joel Berry Excel Programming 9 March 6th 06 10:20 PM


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