PC Review


Reply
Thread Tools Rate Thread

how can i find ' as the first characture in a cell using vba

 
 
oletrol
Guest
Posts: n/a
 
      12th Nov 2008
I am bringing code lines from a module over in to a worksheet and then
searching for a rem " ' " lines and removing them.
BUT once the line is in a cell the ' does not show in any find comand so I
can't find it to remove it. It shows in the formula bar still find don't find
it.
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      12th Nov 2008
Hi,

Right click your sheet tab. view code and paste this in and run it

Sub Kill_The_apostrophe()
For Each c In ActiveSheet.UsedRange
c.Formula = c.Formula
Next
End Sub

Mike

"oletrol" wrote:

> I am bringing code lines from a module over in to a worksheet and then
> searching for a rem " ' " lines and removing them.
> BUT once the line is in a cell the ' does not show in any find comand so I
> can't find it to remove it. It shows in the formula bar still find don't find
> it.

 
Reply With Quote
 
Gene Mills
Guest
Posts: n/a
 
      14th Nov 2008
Hi Mike and thanks before going any farther.

I have been working on this now for several days and still not right

You know that a ' as the first chr in a code line is like a rem chr.

But when the line of code is copied to cell the first ' like an identifier
to show the cell Text as viewed like('=2*2), it shows as =2*2 and without
the ' it appears as the answer to the formula.

I want to be able to find this first ' and then be able to delete the line
or change the ' to something else So I can then find the other ' later in
the code lines in the cells.

The macro you suggested ealier (below) works like a dream to just remove all
of the first ' but does Not allow me to check if first chr is a ' and do
this or do else

If I change this line to be c.Formula = chr(39) & c.Formula it will place an
* in every cell in the range Weather it has an ' or not because chr(39) &
c.formula is still * plus the existing blank formula.

I know of formula, text, an value and what they represent. But I don't know
if there are any other items things or names I could look for, or possibly
change some option that would allow a ' to show or Be seen by vba to do
something with the ' . Could I possibly turn of calculate and be able to do
what I want. ........

Any help would be deeply appreciated

Thanks Again

Gene

"Mike H" <(E-Mail Removed)> wrote in message
news:20604152-C084-4BD8-B657-(E-Mail Removed)...
> Hi,
>
> Right click your sheet tab. view code and paste this in and run it
>
> Sub Kill_The_apostrophe()
> For Each c In ActiveSheet.UsedRange
> c.Formula = c.Formula
> Next
> End Sub
>
> Mike
>
> "oletrol" wrote:
>
>> I am bringing code lines from a module over in to a worksheet and then
>> searching for a rem " ' " lines and removing them.
>> BUT once the line is in a cell the ' does not show in any find comand so
>> I
>> can't find it to remove it. It shows in the formula bar still find don't
>> find
>> it.



 
Reply With Quote
 
 
 
Reply

Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is SearchFormat parameter in cell.Find / Range.Find do? Alex Microsoft Excel Programming 2 16th Apr 2009 03:20 PM
Removing an alpha characture from a column of numbers K Drier Microsoft Excel Worksheet Functions 5 2nd Sep 2008 09:21 PM
Find and Replace - delete the remainder of the text in the cell after my Find ArgarLargar@gmail.com Microsoft Excel Programming 4 4th Aug 2007 03:39 AM
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON CAPTGNVR Microsoft Excel Programming 2 8th Jul 2007 04:18 PM
Find First Non blank cell than find column header and return that value Silver Rose Microsoft Excel Worksheet Functions 10 30th Apr 2007 05:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:19 PM.