Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / July 2006

Tip: Looking for answers? Try searching our database.

absolute formula in Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bhr - 25 Jul 2006 07:30 GMT
Hello all

we need to use absolute formula in most cells, the way that we know is that
use the normal formula and then add $ sign before cell ref.

It is a nightmare to correct all cells manually. is there any way to make it
fix?

Thanks
Dav - 25 Jul 2006 07:51 GMT
The reason for absolute and relative formulas and bits of formulas is
that when you copy them they adjust as you want them to. So at the
moment if your cells are giving the correct answer you need to do
nothing, if you wish to copy them then you only need to adjust one cell
accordingly for each formula type and copy it. Or am I missing
something?

Regards

Dav

Signature

Dav

Harald Staff - 25 Jul 2006 08:32 GMT
Hi

Select the cells and run this macro:

Sub ToAbs()
Dim Cel As Range
For Each Cel In Selection
   If Cel.HasFormula Then
       Cel.Formula = _
           Application.ConvertFormula(Cel.Formula, _
           Application.ReferenceStyle, _
           Application.ReferenceStyle, True)
   End If
Next
End Sub

Note that it works only in A1 style, column headers must be letters.

HTH. Best wishes Harald

> Hello all
>
[quoted text clipped - 5 lines]
>
> Thanks
Gord Dibben - 25 Jul 2006 15:34 GMT
Will a macro solution be OK with you?

Try these.  Ignores cells without formulas.

Sub Absolute()
'$A$1
   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

Sub AbsoluteRow()
'A$1
   Dim cell As Range
   For Each cell In Selection
   If cell.HasFormula Then
      cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlAbsRowRelColumn)
   End If
   Next
End Sub

Sub AbsoluteCol()
'$A1
   Dim cell As Range
   For Each cell In Selection
   If cell.HasFormula Then
      cell.Formula = Application.ConvertFormula(cell.Formula, _
xlA1, xlA1, xlRelRowAbsColumn)
   End If
   Next
End Sub

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

Gord Dibben  MS Excel MVP

>Hello all
>
[quoted text clipped - 5 lines]
>
>Thanks

Gord Dibben  MS Excel MVP

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.