ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   logo to top right of printed page (https://www.excelbanter.com/excel-programming/283184-logo-top-right-printed-page.html)

b1ll

logo to top right of printed page
 

Hi
I am using Excel 97 VBA. I want to put a company logo (picture) on th
top right position of each printed page of an excel sheet.

The page can be portrait or landscape and i have page setup set to
wide ie there may be auto shrink.

I am copying to cell A1 then doing 'ShapeRange.IncrementLeft' for
distance of total column width minus picture width.
This does not place the picture where i expect - it repeats exactly o
any one sheet but varies its placement on different sheets.

Any advice would be welcome.
TIA.
bil

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


BrianB

logo to top right of printed page
 

Here is something that uses the print range setting :-

'--------------------------------------------------------
Sub AddLogo()
Dim PA As Range
Dim RightCell As Range
'---------------------------------
Application.ScreenUpdating = False
Set PA = ActiveSheet.Range("Print_Area")
Set RightCell = PA.Cells(1, PA.Columns.Count)
cright = RightCell.Left + RightCell.Width
'---------------------------------
ActiveSheet.Pictures.Insert ("C:\WINNT\system32\oemlogo.bmp")
pw = ActiveSheet.Pictures(1).Width
pleft = cright - pw
ActiveSheet.Pictures(1).Left = pleft
ActiveSheet.Pictures(1).Top = 0
Application.ScreenUpdating = True
End Sub
'------------------------------------------------------------

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


b1ll[_2_]

logo to top right of printed page
 

Many thanks Brian - looks a neat solution - will give that a try.
cheers
Bil

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com