View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default text alignment settings

You can try the below UDF.

If you are new to VBA set the Security level to low/medium in
(Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From menu 'Insert' a module and paste the below function. Save. Get back to
Workbook.

Function GetValue(varRange As Range, intIndent As Integer)
GetValue = ""
If varRange.IndentLevel = intIndent Then GetValue = varRange
End Function

Now if the data to be extracted is in ColA; in cell B1 enter the below formula

=getvalue(A1,12)

'where 12 represents the indent level. The funciton returns the value if
indent level is 12. You can change the indent level to suit your requirement.

If this post helps click Yes
---------------
Jacob Skaria


"dude_down_under_1" wrote:

Is there a way to get Excel to return the alignment settings of a cell ? I
use the CELL function extensively but it only returns limited information. I
have a spreadsheet provided by a client where I need to extract all rows
which are left aligned with an indent of 12, but I can't find a function that
will return such information to me so that I can do this extract. Any
assistance would be appreciated.