Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Graphics question

Is it possible to place a series of graphics (I have created 1 for each of
our allowed holidays) on a worksheet, and then using code copy the graphic
to another worksheet in the same workbook?

I have created a Template for our vacation calendar so we do not have
recreate it each year. When I start a new year I have conditional formatting
which removes all lines on the calendar for each of the holidays. Then I
want to paste the holidays graphic on the calendar. So say for Christmas I
have a graphic which is named Christmas.gif which I have inserted on a blank
(hidden) worksheet which I would copy to cell B44.

I envision having SheetActivation code which would look something like:

If range ("B60").value = "Christmas" Then

and then the code to copy the graphic Christmas from the hidden holiday
worksheet to cell B44 of the active worksheet.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Graphics question

Have you tried to copy it?

"Patrick C. Simonds" wrote:

Is it possible to place a series of graphics (I have created 1 for each of
our allowed holidays) on a worksheet, and then using code copy the graphic
to another worksheet in the same workbook?

I have created a Template for our vacation calendar so we do not have
recreate it each year. When I start a new year I have conditional formatting
which removes all lines on the calendar for each of the holidays. Then I
want to paste the holidays graphic on the calendar. So say for Christmas I
have a graphic which is named Christmas.gif which I have inserted on a blank
(hidden) worksheet which I would copy to cell B44.

I envision having SheetActivation code which would look something like:

If range ("B60").value = "Christmas" Then

and then the code to copy the graphic Christmas from the hidden holiday
worksheet to cell B44 of the active worksheet.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Graphics question

Yes, it does not record what is being selected:


Sub Macro1()
'
' Macro1 Macro
'

'
Selection.Copy
Sheets("01 Jan 09").Select
Range("AJ22").Select
ActiveSheet.Paste
End Sub





"JLGWhiz" wrote in message
...
Have you tried to copy it?

"Patrick C. Simonds" wrote:

Is it possible to place a series of graphics (I have created 1 for each
of
our allowed holidays) on a worksheet, and then using code copy the
graphic
to another worksheet in the same workbook?

I have created a Template for our vacation calendar so we do not have
recreate it each year. When I start a new year I have conditional
formatting
which removes all lines on the calendar for each of the holidays. Then I
want to paste the holidays graphic on the calendar. So say for Christmas
I
have a graphic which is named Christmas.gif which I have inserted on a
blank
(hidden) worksheet which I would copy to cell B44.

I envision having SheetActivation code which would look something like:

If range ("B60").value = "Christmas" Then

and then the code to copy the graphic Christmas from the hidden holiday
worksheet to cell B44 of the active worksheet.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Graphics question

Following should copy/paste to same position within topleftcell of the
source shape, not necessarily same left & top if row/column widths are
different on respective sheets (otherwise simply copy left/top properties of
source shape to the dest' shape). No sheet or shape selection required.

Sub test()
Dim lt As Single, tp As Single
Dim rTL As Range
Dim shp As Shape

Set shp = ActiveWorkbook.Worksheets("Sheet1").Shapes("Christ mas")

With shp
Set rTL = .TopLeftCell
lt = .Left - rTL.Left
tp = .Top - rTL.Top
.Copy
End With

With ActiveWorkbook.Worksheets("Sheet2")
.Paste
Set rTL = .Range(rTL.Address)
With .Shapes(.Shapes.Count)
.Left = rTL.Left + lt
.Top = rTL.Top + tp
End With
End With

End Sub

Regards,
Peter T

"Patrick C. Simonds" wrote in message
...
Is it possible to place a series of graphics (I have created 1 for each of
our allowed holidays) on a worksheet, and then using code copy the graphic
to another worksheet in the same workbook?

I have created a Template for our vacation calendar so we do not have
recreate it each year. When I start a new year I have conditional
formatting which removes all lines on the calendar for each of the
holidays. Then I want to paste the holidays graphic on the calendar. So
say for Christmas I have a graphic which is named Christmas.gif which I
have inserted on a blank (hidden) worksheet which I would copy to cell
B44.

I envision having SheetActivation code which would look something like:

If range ("B60").value = "Christmas" Then

and then the code to copy the graphic Christmas from the hidden holiday
worksheet to cell B44 of the active worksheet.



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
Bug with graphics NehalemLabs Excel Discussion (Misc queries) 0 June 13th 06 05:58 PM
Graphics question on Excel VBA UserForm Jens Meier Excel Programming 9 July 23rd 05 11:10 PM
API graphics question Mike510 Excel Programming 2 January 3rd 05 12:37 PM
VBA - graphics Bruce Williams[_3_] Excel Programming 0 April 27th 04 11:51 PM
Graphics alexm999[_17_] Excel Programming 1 January 31st 04 04:12 AM


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