Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
metalsped
 
Posts: n/a
Default Any way to center a graphic in a particular cell?


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: http://www.excelforum.com/member.php...o&userid=22824
View this thread: http://www.excelforum.com/showthread...hreadid=539392

  #2   Report Post  
Posted to microsoft.public.excel.misc
metalsped
 
Posts: n/a
Default Any way to center a graphic in a particular cell?


Yay, pity bump.


--
metalsped
------------------------------------------------------------------------
metalsped's Profile: http://www.excelforum.com/member.php...o&userid=22824
View this thread: http://www.excelforum.com/showthread...hreadid=539392

  #3   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Any way to center a graphic in a particular cell?

Graphics 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:
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!




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #4   Report Post  
Posted to microsoft.public.excel.misc
metalsped
 
Posts: n/a
Default Any way to center a graphic in a particular cell?


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:
Graphics 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:
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!




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



--
metalsped
------------------------------------------------------------------------
metalsped's Profile: http://www.excelforum.com/member.php...o&userid=22824
View this thread: http://www.excelforum.com/showthread...hreadid=539392

  #5   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Any way to center a graphic in a particular cell?

Assuming 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:
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:

Graphics 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:

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!




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html



  #6   Report Post  
Posted to microsoft.public.excel.misc
metalsped
 
Posts: n/a
Default Any way to center a graphic in a particular cell?


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: http://www.excelforum.com/member.php...o&userid=22824
View this thread: http://www.excelforum.com/showthread...hreadid=539392

  #7   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Any way to center a graphic in a particular cell?

Store the code in a regular code module, as described he

http://www.contextures.com/xlvba01.html

To run the code, you can choose ToolsMacroMacros
Select the CentreGraphics macro in the list, then click the Run button.

metalsped wrote:
I feel quite silly asking, but where exactly in my excel sheet do I put
code like that? Sorry for all the questions.




--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #8   Report Post  
Posted to microsoft.public.excel.misc
metalsped
 
Posts: n/a
Default Any way to center a graphic in a particular cell?


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: http://www.excelforum.com/member.php...o&userid=22824
View this thread: http://www.excelforum.com/showthread...hreadid=539392

  #9   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default Any way to center a graphic in a particular cell?

Hi 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

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
How do I "lock" a graphic to a particular cell in Excel? Darlene Excel Worksheet Functions 2 March 28th 06 10:17 AM
Referencing a cell containing a graphic jfenley Excel Discussion (Misc queries) 1 January 3rd 06 12:06 PM
Dates of a Day for a month & year cell formulas mikeburg Excel Discussion (Misc queries) 2 December 29th 05 10:14 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM


All times are GMT +1. The time now is 07:13 AM.

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"