logo to top right of printed page

B

b1ll

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
 
B

BrianB

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
'------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top