Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old June 7th, 2007, 09:15 PM
code_man code_man is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 135 code_man User rank is Corporal (100 - 500 Reputation Level)code_man User rank is Corporal (100 - 500 Reputation Level)code_man User rank is Corporal (100 - 500 Reputation Level)code_man User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 16 m 57 sec
Reputation Power: 7
Other Language - Excel Search & Replace Question

Is it possible in Microsoft Excel to perform a search and replace on a column of information that accomplishes the following:

S5-B1 -> S5-B01
S5-B2 -> S5-B02
S5-B3 -> S5-B03
S5-B4 -> S5-B04

I'm basically looking to force the single digit after the letter "B" to be a minimum of 2 digits wide. Any suggestions would be appreciated.

Reply With Quote
  #2  
Old June 11th, 2007, 10:58 AM
medialint's Avatar
medialint medialint is offline
spirit duplicator
Click here for more information.
 
Join Date: Apr 2004
Location: \\Firecrate\
Posts: 12,325 medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)medialint User rank is General 24th Grade (Above 100000 Reputation Level)  Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1Folding Points: 232775 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 11 h 47 m 19 sec
Reputation Power: 2578
Not with search and replace I don't think but its simple enough with a little VBA. This function would convert the first four characters + zero pad (to two) the last number(s)

Code:
Public Function ConvertCol(strIn As String) As String
    ConvertCol = Left(strIn, 4) + Format(Right(strIn, Len(strIn) - 4), "00")
End Function


You can then use it as a worksheet function, e.g. the formula in B1 might be:
=ConvertCol(A1)

Attached Images
File Type: gif convertcol.gif (3.6 KB, 152 views)
__________________
medialint.com

"Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Other Language - Excel Search & Replace Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway