Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2007, 03:49 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default remove characters from "=" and before

dear all

I wish to remove all the characters from "=" and before. How would i do that?

example:
test=123
dfdfadfdfa=54443333
fgs=432124

Is there a macro to remove every start from "=" and before?

 
Old February 27th, 2007, 05:08 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

If you want to do with Excel formula here you have

=MID(B1,FIND("=",B1,1)+1,LEN(B1))

Replace B1 with appropriate Range

else

If you want to use the VBA, then use split function to split the cell and take the second or maximum element of the array

Cheers,
Shasur

http://www.vbadud.blogspot.com
 
Old February 27th, 2007, 06:02 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

THANKS. I used instr and everything seems working :

Sub SplitCellValue()
  Dim I As Long
  Dim Cell As Range

    For Each Cell In Range("A1:BW3000")

      I = InStr(Cell.Value, "=")
       If I > 0 Then
           Cell.Value = Mid(Cell.Value, I + 1, Len(Cell.Value))
       End If


    Next Cell

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
code to remove ms word special characters vikaspa Pro PHP 0 November 27th, 2008 10:20 PM
Custom script to remove special characters midoriweb Classic ASP Basics 2 January 12th, 2007 08:05 AM
javascript remove bad characters for MySQL db hit crmpicco Javascript How-To 25 March 29th, 2006 06:34 AM
How to remove ? abdusalam Javascript How-To 1 July 27th, 2004 01:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.