#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default batch edit cells

I have a bunch of cells which contain a reference but are missing the = sign
how can I add the = sign to complete reference in one go instead of one by one
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default batch edit cells

Hi,

To do it in the same cell requires code. Right click your sheet tab, view
code and paste the code below in and run it. Change the range to suit your
range

Sub adddequals()
Range("A1:a100").Value = Evaluate("""=""&A1:A100")
End Sub

Mike

"willemeulen" wrote:

I have a bunch of cells which contain a reference but are missing the = sign
how can I add the = sign to complete reference in one go instead of one by one

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default batch edit cells

I'd use a macro:

Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells.SpecialCells(xlCellTypeConstants, xlTextValues))
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "No text constants in this range"
Exit Sub
End If

For Each myCell In myRng.Cells
With myCell
If .Len(.Value) 0 Then
.NumberFormat = "General" 'or what you want
.Formula = "=" & .Value
End If
End With
Next myCell

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

willemeulen wrote:

I have a bunch of cells which contain a reference but are missing the = sign
how can I add the = sign to complete reference in one go instead of one by one


--

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
run batch job from each row - how to insert run batch function per row? Mitchell_Collen via OfficeKB.com Excel Discussion (Misc queries) 5 February 26th 09 07:16 AM
how to edit cells Ralf Dieckmann New Users to Excel 2 April 14th 08 10:58 PM
Making Cells so no one can edit FormulaQuestioner Excel Discussion (Misc queries) 2 February 7th 08 03:35 AM
Prevent edit of cells Freshman Excel Worksheet Functions 5 November 1st 07 06:59 PM
edit cells only with authority zhj23 Excel Discussion (Misc queries) 1 May 24th 05 06:17 AM


All times are GMT +1. The time now is 10:08 AM.

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

About Us

"It's about Microsoft Excel"