Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Deleting ' before cell contents

I ill-advisedly added ' before a bunch of formulas because I wanted to move
the formulas between workbooks and have them reference the current workbook.
I thought that I would be able to find and replace the ' from the formula but
I am having trouble doing that. (I Believe it is char(39) FYI).

Does know of a way to remedy this.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Deleting ' before cell contents

Andy,

I tried this subroutine and it worked.

Sub test()
Dim c As Range
For Each c In ActiveSheet.UsedRange
If Left(c.Value, 1) = "=" Then
c.Formula = c.Value
End If
Next c
End Sub



--

Hope that helps.

Vergel Adriano


"Andy" wrote:

I ill-advisedly added ' before a bunch of formulas because I wanted to move
the formulas between workbooks and have them reference the current workbook.
I thought that I would be able to find and replace the ' from the formula but
I am having trouble doing that. (I Believe it is char(39) FYI).

Does know of a way to remedy this.

Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Deleting ' before cell contents

That worked.

Does anyone happen to know of a way to circumvent this problem? By that I
mean a way to copy formulas from one workbook to another without having them
refer back to the original workbook.


"Vergel Adriano" wrote:

Andy,

I tried this subroutine and it worked.

Sub test()
Dim c As Range
For Each c In ActiveSheet.UsedRange
If Left(c.Value, 1) = "=" Then
c.Formula = c.Value
End If
Next c
End Sub



--

Hope that helps.

Vergel Adriano


"Andy" wrote:

I ill-advisedly added ' before a bunch of formulas because I wanted to move
the formulas between workbooks and have them reference the current workbook.
I thought that I would be able to find and replace the ' from the formula but
I am having trouble doing that. (I Believe it is char(39) FYI).

Does know of a way to remedy this.

Thanks,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Deleting ' before cell contents

I'd use the same technique as you did--but with a different string:

Select all the cells
edit|replace
what: = (equal sign)
with: $$$$$=
replace all.

Then do the copy.

When you're done, you can reverse the edit|replace.

The choice of using the apostrophe was your Achille's heal.



Andy wrote:

That worked.

Does anyone happen to know of a way to circumvent this problem? By that I
mean a way to copy formulas from one workbook to another without having them
refer back to the original workbook.

"Vergel Adriano" wrote:

Andy,

I tried this subroutine and it worked.

Sub test()
Dim c As Range
For Each c In ActiveSheet.UsedRange
If Left(c.Value, 1) = "=" Then
c.Formula = c.Value
End If
Next c
End Sub



--

Hope that helps.

Vergel Adriano


"Andy" wrote:

I ill-advisedly added ' before a bunch of formulas because I wanted to move
the formulas between workbooks and have them reference the current workbook.
I thought that I would be able to find and replace the ' from the formula but
I am having trouble doing that. (I Believe it is char(39) FYI).

Does know of a way to remedy this.

Thanks,


--

Dave Peterson
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
How can I delete the contents of a cell without deleting the formu 6js59 Excel Discussion (Misc queries) 0 June 3rd 08 07:01 PM
alert before deleting contents of a cell Mortgage Man Excel Discussion (Misc queries) 3 December 15th 06 04:30 PM
Macro Help for Deleting Blank Rows & Clearing Cell Contents ksp Excel Programming 2 January 13th 06 05:25 AM
Deleting rows dependent upon cell contents daedalus1 Excel Programming 4 October 25th 05 02:05 PM
looping through range and deleting cell contents. Andy Healey Excel Programming 1 December 31st 03 09:48 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"