Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Retrieve or extract cell formatting information using VBA

I would like to know whether there is an efficient way of retrieving
all the cell formatting information in one go and represent it as one
string? There is always the hard way of walking through the entire cell
object model and retrieve property by property but would prefer
something more efficient? E.g. reading the content of the format
painter or so. If the entire cell format can be represented as one
string, is there also a way to apply this formatting string to the cell
again?

Thanks in advance,
Reto

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Retrieve or extract cell formatting information using VBA

"There is always the hard way of walking through the entire cell
object model and retrieve property by property but would prefer
something more efficient?"

AFAIK, there's no other way to do it. There is no one "property" format that
you could save into a variable. There are many format properties:
numberformat, horizontal and vertical alignment, merge cells, wrap text, all
of the font characteristics (name, size, bold or italic or underlined or
strikethough etc), interior color index, 6 different borders, conditional
formatting, etc, etc, etc.

If you write the code to retrieve those settings and create such a string,
then the only way to apply those settings to a cell would be with more code
that parses that string and applies the settings.

If you want to quickly reapply a group of formats, I would copy the format to
another cell to be used as a sort of "buffer" (Edit/Copy, then Edit/Paste
Special/Formats). Then to reuse the format, you would copy that buffer cell
and paste its format wherever you want. This cell would have to be protected
from changes by the user, of course.


On 1 Oct 2005 17:13:23 -0700, "
wrote:

I would like to know whether there is an efficient way of retrieving
all the cell formatting information in one go and represent it as one
string? There is always the hard way of walking through the entire cell
object model and retrieve property by property but would prefer
something more efficient? E.g. reading the content of the format
painter or so. If the entire cell format can be represented as one
string, is there also a way to apply this formatting string to the cell
again?

Thanks in advance,
Reto

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Retrieve or extract cell formatting information using VBA

Too bad nothing more efficient exists. Oh well, than I will get started
for the hard way. Thanks anyway for your prompt reply.

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
Retrieve information from one workbook to another Help with cell function[_2_] Excel Discussion (Misc queries) 2 October 22nd 09 03:01 PM
Macro to retrieve information Unique713 Excel Discussion (Misc queries) 2 November 25th 08 04:05 PM
Retrieve Information based on Condition aposatsk Excel Discussion (Misc queries) 2 August 2nd 06 01:52 PM
Please help: Extract some information from a cell Bobsus5 Excel Discussion (Misc queries) 2 March 7th 06 03:11 AM
retrieve cell formatting with IF(HLOOKUP) formula useR Excel Worksheet Functions 2 August 3rd 05 06:55 PM


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