close

I have a small graphic that I need into insert to every applicable cell,
in a certain column. Is there any sort of way that excel can be
formatted to have this graphic be centered in each cell? It is quite
tough to keep everything centered by hand. Thanks!--
metalsped
------------------------------------------------------------------------
metalsped's Profile: www.excelforum.com/member.php...oamp;userid=22824
View this thread: www.excelforum.com/showthread...hreadid=539392
Yay, pity bump.--
metalsped
------------------------------------------------------------------------
metalsped's Profile: www.excelforum.com/member.php...oamp;userid=22824
View this thread: www.excelforum.com/showthread...hreadid=539392Graphics float over cells, so they aren't affected by cell formatting.
You could use programming to centre the graphics, but there's no
built-in command that will centre them.

metalsped wrote:
gt; I have a small graphic that I need into insert to every applicable cell,
gt; in a certain column. Is there any sort of way that excel can be
gt; formatted to have this graphic be centered in each cell? It is quite
gt; tough to keep everything centered by hand. Thanks!
gt;
gt;--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Well this is for work, so it needs to be professional looking. Provided
I dont have to write an encyclopedia worth of commands for every box, I
would love to try out the program (if you know it). Thanks

Debra Dalgleish Wrote:
gt; Graphics float over cells, so they aren't affected by cell formatting.
gt; You could use programming to centre the graphics, but there's no
gt; built-in command that will centre them.
gt;
gt; metalsped wrote:
gt; gt; I have a small graphic that I need into insert to every applicable
gt; cell,
gt; gt; in a certain column. Is there any sort of way that excel can be
gt; gt; formatted to have this graphic be centered in each cell? It is quite
gt; gt; tough to keep everything centered by hand. Thanks!
gt; gt;
gt; gt;
gt;
gt;
gt; --
gt; Debra Dalgleish
gt; Contextures
gt; www.contextures.com/tiptech.html--
metalsped
------------------------------------------------------------------------
metalsped's Profile: www.excelforum.com/member.php...oamp;userid=22824
View this thread: www.excelforum.com/showthread...hreadid=539392Assuming the graphics are narrower than the columns, you could use code
similar to the following:

'====================
Sub CentreGraphics()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Left = shp.TopLeftCell.Left _
(shp.TopLeftCell.Width - shp.Width) / 2
Next shp
End Sub
'=====================

metalsped wrote:
gt; Well this is for work, so it needs to be professional looking. Provided
gt; I dont have to write an encyclopedia worth of commands for every box, I
gt; would love to try out the program (if you know it). Thanks
gt;
gt; Debra Dalgleish Wrote:
gt;
gt;gt;Graphics float over cells, so they aren't affected by cell formatting.
gt;gt;You could use programming to centre the graphics, but there's no
gt;gt;built-in command that will centre them.
gt;gt;
gt;gt;metalsped wrote:
gt;gt;
gt;gt;gt;I have a small graphic that I need into insert to every applicable
gt;gt;
gt;gt;cell,
gt;gt;
gt;gt;gt;in a certain column. Is there any sort of way that excel can be
gt;gt;gt;formatted to have this graphic be centered in each cell? It is quite
gt;gt;gt;tough to keep everything centered by hand. Thanks!
gt;gt;gt;
gt;gt;gt;
gt;gt;
gt;gt;
gt;gt;--
gt;gt;Debra Dalgleish
gt;gt;Contextures
gt;gt;www.contextures.com/tiptech.html
gt;
gt;
gt;--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
I feel quite silly asking, but where exactly in my excel sheet do I put
code like that? Sorry for all the questions.--
metalsped
------------------------------------------------------------------------
metalsped's Profile: www.excelforum.com/member.php...oamp;userid=22824
View this thread: www.excelforum.com/showthread...hreadid=539392Store the code in a regular code module, as described he

www.contextures.com/xlvba01.html

To run the code, you can choose Toolsgt;Macrogt;Macros
Select the CentreGraphics macro in the list, then click the Run button.

metalsped wrote:
gt; I feel quite silly asking, but where exactly in my excel sheet do I put
gt; code like that? Sorry for all the questions.
gt;
gt;--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
I'm halfway there. Thank you thus far Debra. It appears with that
coding, that it is centered vertically. Is there any way to have it
centered horizontally as well?--
metalsped
------------------------------------------------------------------------
metalsped's Profile: www.excelforum.com/member.php...oamp;userid=22824
View this thread: www.excelforum.com/showthread...hreadid=539392Hi metalsped,

try...

Sub CentreGraphics()
Dim shp As Shape
For Each shp In ActiveSheet.Shapes
shp.Left = shp.TopLeftCell.Left _
(shp.TopLeftCell.Width - shp.Width) / 2
shp.Top = shp.TopLeftCell.Top _
(shp.TopLeftCell.Height - shp.Height) / 2
Next shp
End Sub

Ken Johnson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()