Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default $ sign in Formula with cell referce

Hi all, In Range("B1:B5") I have formulas like see below

=A1
=A2
=A3
=A4
=A5

Is there some way or macro in excel that I should select Range
("B1:B5") and click some button or some thing and all the formulas
become like see below

=$A$1
=$A$2
=$A$3
=$A$4
=$A$5

above is just a small example to explain my question but I have
formulas in lots of rows and cloumns and I want them to appear as
shown above in second example. I am looking for some way to just
select the range in which i have the formulas and do some thing or run
some macro which fixes all the cell referces in formula. I hope i was
able to explain my question. Can please any friend help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default $ sign in Formula with cell referce

Sub RelToAbs()
Dim rng As Range, cel As Range

' adapt to suit
Set rng = ActiveSheet.UsedRange
Set rng = Selection
Set rng = Range("B1:D10")

On Error GoTo errExit
Set rng = rng.SpecialCells(xlCellTypeFormulas, 23)
On Error Goto 0

For Each cel In rng
With cel
..Formula = Application.ConvertFormula(.Formula, xlA1, xlA1, xlAbsolute)
End With
Next
errExit:
End Sub

Regards,
Peter T

"K" wrote in message
...
Hi all, In Range("B1:B5") I have formulas like see below

=A1
=A2
=A3
=A4
=A5

Is there some way or macro in excel that I should select Range
("B1:B5") and click some button or some thing and all the formulas
become like see below

=$A$1
=$A$2
=$A$3
=$A$4
=$A$5

above is just a small example to explain my question but I have
formulas in lots of rows and cloumns and I want them to appear as
shown above in second example. I am looking for some way to just
select the range in which i have the formulas and do some thing or run
some macro which fixes all the cell referces in formula. I hope i was
able to explain my question. Can please any friend help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default $ sign in Formula with cell referce

Hi,

Select your cells and use this macro

Sub Sonic()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsolute)
End If
Next
End Sub


Mike

"K" wrote:

Hi all, In Range("B1:B5") I have formulas like see below

=A1
=A2
=A3
=A4
=A5

Is there some way or macro in excel that I should select Range
("B1:B5") and click some button or some thing and all the formulas
become like see below

=$A$1
=$A$2
=$A$3
=$A$4
=$A$5

above is just a small example to explain my question but I have
formulas in lots of rows and cloumns and I want them to appear as
shown above in second example. I am looking for some way to just
select the range in which i have the formulas and do some thing or run
some macro which fixes all the cell referces in formula. I hope i was
able to explain my question. Can please any friend help

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
plus sign before cell reference in formula KrispyData New Users to Excel 3 April 28th 23 11:44 AM
Why put a plus sign after = sign in a formula kMan Excel Worksheet Functions 3 April 4th 23 10:26 AM
= sign in formula changes to + when adding a cell or name Steve Excel Discussion (Misc queries) 2 May 19th 09 04:02 PM
How to put + sign in cell, not formula? slp2b Excel Discussion (Misc queries) 1 September 27th 08 05:37 PM
how can i change dollar sign to rupee sign in sales invoice vishal kohli Excel Discussion (Misc queries) 3 May 10th 07 02:06 PM


All times are GMT +1. The time now is 02:24 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"