Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Change "relative" to "absolute" (database)

Routine to change datacell range BS5:BU80 from relative to absolute values,
please ?

(example, cell BS5 content "=C5+C80+C155+C305"

Excel method works only on single cells (select cell, highlight content in
function bar, press function key f4 3 times) BUT it doesn't work on a
highlighted range, neither can I construct an effective macro via macro
wizard.
I have 4 such data blocks (900 cells), and a short deadline for final report
print (tonight) which are these data blocks, data sorted (and data sort
doesn't work with relative values).
Any suggestion appreciated !

LEN


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Change "relative" to "absolute" (database)

Len,

Try something like the following:

Sub ConvertFormulas()
Dim Rng As Range
On Error GoTo EndProc:
For Each Rng In Range("A1:A10").SpecialCells(xlCellTypeFormulas)
If Rng.HasArray = True Then
Rng.FormulaArray = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
Else
Rng.Formula = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
End If
Next Rng
EndProc:
End Sub

Change the range A1:A10 to the appropriate cell range.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Len Dolby" wrote in message
...
Routine to change datacell range BS5:BU80 from relative to absolute

values,
please ?

(example, cell BS5 content "=C5+C80+C155+C305"

Excel method works only on single cells (select cell, highlight content in
function bar, press function key f4 3 times) BUT it doesn't work on a
highlighted range, neither can I construct an effective macro via macro
wizard.
I have 4 such data blocks (900 cells), and a short deadline for final

report
print (tonight) which are these data blocks, data sorted (and data sort
doesn't work with relative values).
Any suggestion appreciated !

LEN




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Change "relative" to "absolute" (database)

This worked superbly. However, my datarange still will not sort.
It is now entirely populated by references to external data cells (and ALL
external cells are now also absolute refs, where appropriate)
I think sort failure may be because I did not include brackets in the source
cells i.e. =$a$5+$b$5, not =($a$5+$b$5) - seem to recall reading this as a
possibilty, NB I am a relative newbie ...

So - routine to add brackets, similar to below ?
And, the REVERSE of the "Absolute" routine (or, to remove the absolute
COLUMN, so $A$% becomes $A5 ? this so i can copy/paste corrected cells ?
"Chip Pearson" wrote in message
...
Len,

Try something like the following:

Sub ConvertFormulas()
Dim Rng As Range
On Error GoTo EndProc:
For Each Rng In Range("A1:A10").SpecialCells(xlCellTypeFormulas)
If Rng.HasArray = True Then
Rng.FormulaArray = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
Else
Rng.Formula = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
End If
Next Rng
EndProc:
End Sub

Change the range A1:A10 to the appropriate cell range.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Len Dolby" wrote in message
...
Routine to change datacell range BS5:BU80 from relative to absolute

values,
please ?

(example, cell BS5 content "=C5+C80+C155+C305"

Excel method works only on single cells (select cell, highlight content

in
function bar, press function key f4 3 times) BUT it doesn't work on a
highlighted range, neither can I construct an effective macro via macro
wizard.
I have 4 such data blocks (900 cells), and a short deadline for final

report
print (tonight) which are these data blocks, data sorted (and data sort
doesn't work with relative values).
Any suggestion appreciated !

LEN






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change "relative" to "absolute" (database)

The values you can supply to the 4th argument of the the convertformula
function a

? xlAbsolute
1
? xlAbsRowRelColumn
2
? xlRelRowAbsColumn
3
? xlRelative
4


Not sure why Chip chose to use True (which evaluated to 1 and would be
equivalent to xlAbsolute).

Replace true with one of the other constants.

Adding brackets will have no affect on how the sort is performed as they
will not change the value produced. The value produced determines what the
sort order is.

If the cell reference is to a value in the same row that is also sorted, it
should be row relative. If it refers to a cell outside the area to be
sorted, it should be row abosolute.

--
Regards,
Tom Ogilvy

"Len Dolby" wrote in message
...
This worked superbly. However, my datarange still will not sort.
It is now entirely populated by references to external data cells (and ALL
external cells are now also absolute refs, where appropriate)
I think sort failure may be because I did not include brackets in the

source
cells i.e. =$a$5+$b$5, not =($a$5+$b$5) - seem to recall reading this as

a
possibilty, NB I am a relative newbie ...

So - routine to add brackets, similar to below ?
And, the REVERSE of the "Absolute" routine (or, to remove the absolute
COLUMN, so $A$% becomes $A5 ? this so i can copy/paste corrected cells ?
"Chip Pearson" wrote in message
...
Len,

Try something like the following:

Sub ConvertFormulas()
Dim Rng As Range
On Error GoTo EndProc:
For Each Rng In Range("A1:A10").SpecialCells(xlCellTypeFormulas)
If Rng.HasArray = True Then
Rng.FormulaArray = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
Else
Rng.Formula = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
End If
Next Rng
EndProc:
End Sub

Change the range A1:A10 to the appropriate cell range.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Len Dolby" wrote in message
...
Routine to change datacell range BS5:BU80 from relative to absolute

values,
please ?

(example, cell BS5 content "=C5+C80+C155+C305"

Excel method works only on single cells (select cell, highlight

content
in
function bar, press function key f4 3 times) BUT it doesn't work on a
highlighted range, neither can I construct an effective macro via

macro
wizard.
I have 4 such data blocks (900 cells), and a short deadline for final

report
print (tonight) which are these data blocks, data sorted (and data

sort
doesn't work with relative values).
Any suggestion appreciated !

LEN








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Change "relative" to "absolute" (database)

Tom, thanks ! Your suggested amendment to argument 4 works fine, I've used
it.
Am sending you the file as I can't get a correct datasort, despite doing
what you suggested
Please reply soonest, I really am up against a deadline - have to print and
then hand=deliver prior to a Club meeting
Sorry to claim priority I know you help a lot of folk !
Sincerely, Len


"Tom Ogilvy" wrote in message
...
The values you can supply to the 4th argument of the the convertformula
function a

? xlAbsolute
1
? xlAbsRowRelColumn
2
? xlRelRowAbsColumn
3
? xlRelative
4


Not sure why Chip chose to use True (which evaluated to 1 and would be
equivalent to xlAbsolute).

Replace true with one of the other constants.

Adding brackets will have no affect on how the sort is performed as they
will not change the value produced. The value produced determines what

the
sort order is.

If the cell reference is to a value in the same row that is also sorted,

it
should be row relative. If it refers to a cell outside the area to be
sorted, it should be row abosolute.

--
Regards,
Tom Ogilvy

"Len Dolby" wrote in message
...
This worked superbly. However, my datarange still will not sort.
It is now entirely populated by references to external data cells (and

ALL
external cells are now also absolute refs, where appropriate)
I think sort failure may be because I did not include brackets in the

source
cells i.e. =$a$5+$b$5, not =($a$5+$b$5) - seem to recall reading this

as
a
possibilty, NB I am a relative newbie ...

So - routine to add brackets, similar to below ?
And, the REVERSE of the "Absolute" routine (or, to remove the absolute
COLUMN, so $A$% becomes $A5 ? this so i can copy/paste corrected cells ?
"Chip Pearson" wrote in message
...
Len,

Try something like the following:

Sub ConvertFormulas()
Dim Rng As Range
On Error GoTo EndProc:
For Each Rng In Range("A1:A10").SpecialCells(xlCellTypeFormulas)
If Rng.HasArray = True Then
Rng.FormulaArray = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
Else
Rng.Formula = Application.ConvertFormula(Rng.Formula, _
xlA1, xlA1, True)
End If
Next Rng
EndProc:
End Sub

Change the range A1:A10 to the appropriate cell range.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Len Dolby" wrote in message
...
Routine to change datacell range BS5:BU80 from relative to absolute
values,
please ?

(example, cell BS5 content "=C5+C80+C155+C305"

Excel method works only on single cells (select cell, highlight

content
in
function bar, press function key f4 3 times) BUT it doesn't work on

a
highlighted range, neither can I construct an effective macro via

macro
wizard.
I have 4 such data blocks (900 cells), and a short deadline for

final
report
print (tonight) which are these data blocks, data sorted (and data

sort
doesn't work with relative values).
Any suggestion appreciated !

LEN










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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Relative" Absolute Cell References in Excel 2007 [email protected] Excel Worksheet Functions 4 December 29th 07 04:48 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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