Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default text alignment settings

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default text alignment settings

I'm not sure exactly what you need in the end (cells, multiple cells in a
row, the entire row, something else), but perhaps this non-VB procedure
might be of use (if you really need this in VB, the procedure can be coded).
Click Edit/Find on Excel's menu bar, click the "Options" button to display
the full options for the dialog box (unless the options are already
displayed, of course), leave the "Find what" field blank (empty, with
nothing in it) and click the Format button. Click the "Alignment" tab and
select "Left (Indent)" from the Horizontal drop down and put 12 in the
Indent field and then click the OK button. Now, click the "Find All" button
and then key in Ctrl+A.... doing this will select every cell on the
worksheet with that particular format.

--
Rick (MVP - Excel)


"dude_down_under_1" wrote in
message ...
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.


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
In Cell alignment, how do I update the default vertical alignment How to update default cell alignment Setting up and Configuration of Excel 2 February 4th 09 02:25 PM
Text Alignment Ben Excel Discussion (Misc queries) 3 August 20th 07 07:48 PM
Text alignment dkingfish Excel Discussion (Misc queries) 0 January 22nd 07 03:44 PM
default settings under alignment tab in Excel Larry Black Excel Discussion (Misc queries) 1 June 16th 05 11:43 PM
Top alignment with vertical text? Al Excel Discussion (Misc queries) 2 December 6th 04 06:19 AM


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