Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 14th, 2006, 11:19 PM
Authorized User
Join Date: Nov 2005
Location: phoenix, AZ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Seperating a cell

I need to compare one cell formated like:12345678 to one formated like: 1234-5678 and copy the matched ones. I planned to compare the first four digits of the cell to the first four of the other, and then the last four likewise. I'm having trouble trying to seperate the cell into the first four. I thought it would be something like string1.textleft4 or something like that, I don't know, but it's not working. Any help in the right direction, or a better way, would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old November 14th, 2006, 11:30 PM
Friend of Wrox
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts

Hey Reverand,

Try this... if the number that needs altering is cell B2

=Left(B2, 4) & Right(B2, 4)

If you are then comparing that against a number, it may still be a problem because that may be considered a text string. (Of course it might not:D

If it does, I think the following might work...

=(Left(B2, 4) & Right(B2, 4)) * 1

Hope that helps,


Reply With Quote
  #3 (permalink)  
Old November 14th, 2006, 11:46 PM
Authorized User
Join Date: Nov 2005
Location: phoenix, AZ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

The second one worked, thank you very much sir.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seperating Tickers keithd Excel VBA 1 January 28th, 2007 07:12 PM
I need to refer a cell within a cell like =RC[ RC2 chakravarthi_os Excel VBA 1 September 24th, 2006 08:19 AM
Seperating Layers rodmcleay BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 August 21st, 2006 10:38 AM
Seperating Date part from a datetime field ctranjith SQL Server 2000 2 October 25th, 2004 06:42 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM

All times are GMT -4. The time now is 09:38 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.