LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default .ReferenceStyle=xlA1 Converting Relative to Absolute References?

After I get done building a sheet in VBA (which
has .ReferenceStyle=xlR1C1), I have a cell where .FormulaR1C1=R6C15/
R111C15.

Users, however, do not care for that reference style, so at the end of
my coding I do a .ReferenceStyle=xlA1.

At that time, abovementioned cell's .FormulaR1C1 changes to "=$O$6/$O
$111". I.E. an absolute reference.

Same thing, of course, happens if I rem out the ref style change and
just do an Options | General | R1C1 reference style = False.

In retrospect, this seems like that's the way it has to be: that
"R6C15/R111C15" is inherantly an absolute reference.

A problem arises, however: the user sometimes re-sorts the sheet.
The row, of course dutifully moves to it's expected location depending
on the sort criteria. But the absolute reference remains and the
number for that cell is now incorrect - being computed from some other
row's data.

In the example, I want the "R5C15" part of the formula to be relative
and the "R11C15" part of the formula to be absolute.

Can somebody put me on the Good-Right-And-Holy path VBA-wise?

Maybe keeping .ReferenceStyle=xlA1, but invoking some kind of column
number conversion function to get the alphabetic equivalent of a
column number?
 
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
absolute & relative references zzulu4 Excel Discussion (Misc queries) 2 April 1st 09 05:54 PM
Something other than Absolute, Relative or Mixed references veryeavy Excel Discussion (Misc queries) 16 January 7th 09 12:46 AM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
how to switch between relative and absolute references KeKe New Users to Excel 2 June 9th 06 05:23 PM
Absolute / Relative References Tim Mills Excel Programming 2 July 25th 05 12:32 PM


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