Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Paste to active Cell

I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.

thanks in advance

Here is the code

Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste to active Cell

You have to paste and then move the item.

I had to postion a lot of charts and used these statements to get it to work

Worksheets(TemperatureSheetName).Shapes(ChartName) .Top = _
Worksheets(TemperatureSheetName). _
Rows((ChartRowOffset * (ModChartNumber)) + 1).Top
Worksheets(TemperatureSheetName).Shapes(ChartName) .Left = _
Worksheets(TemperatureSheetName).Columns(MyColumnO ffset).Left


"Thomp" wrote:

I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.

thanks in advance

Here is the code

Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Paste to active Cell

Give this a whirl...

Sheets("Sheet1").Shapes("AutoShape 4").Copy
ActiveSheet.Paste

--
HTH...

Jim Thomlinson


"Thomp" wrote:

I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.

thanks in advance

Here is the code

Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Paste to active Cell

What do you mean by paste to the cell below. The top left corner of the
pasted shape overlaps cell F9, at least in my testing it does.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Thomp" wrote in message
ups.com...
I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.

thanks in advance

Here is the code

Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste to active Cell

To find object on a page you can use (see below) then you can delete object
and move objects.

For Each AllCharts In Worksheets(TemperatureSheetName).Shapes

Next allcharts


"Thomp" wrote:

I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.

thanks in advance

Here is the code

Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Paste to active Cell

On Feb 15, 10:40 am, "Bob Phillips" wrote:
What do you mean by paste to the cell below. The top left corner of the
pasted shape overlaps cell F9, at least in my testing it does.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Thomp" wrote in message

ups.com...



I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.


thanks in advance


Here is the code


Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste- Hide quoted text -


- Show quoted text -


I just got part of it to work. It now copies and pastes to my active
cell but my only problem now is that there is an object or shape
already in the cell and I need to delete it first before I paste the
new object into cell

One important point the object name ("Autoshape 42") will change every
time so the code can't look for it by name but rather by the fact I am
in that active cell before I run the macro

thanks,
Bill
Here is the new code

ActiveCell.Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
ActiveCell.Select
ActiveSheet.Paste

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Paste to active Cell

Thom: from Joel Look at the code I sent. You will see .top and .left to
indicate how the object gets referenced to the cell location.

"Thomp" wrote:

On Feb 15, 10:40 am, "Bob Phillips" wrote:
What do you mean by paste to the cell below. The top left corner of the
pasted shape overlaps cell F9, at least in my testing it does.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Thomp" wrote in message

ups.com...



I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.


thanks in advance


Here is the code


Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste- Hide quoted text -


- Show quoted text -


I just got part of it to work. It now copies and pastes to my active
cell but my only problem now is that there is an object or shape
already in the cell and I need to delete it first before I paste the
new object into cell

One important point the object name ("Autoshape 42") will change every
time so the code can't look for it by name but rather by the fact I am
in that active cell before I run the macro

thanks,
Bill
Here is the new code

ActiveCell.Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
ActiveCell.Select
ActiveSheet.Paste


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Paste to active Cell

On Feb 15, 12:47 pm, Joel wrote:
Thom: from Joel Look at the code I sent. You will see .top and .left to
indicate how the object gets referenced to the cell location.



"Thomp" wrote:
On Feb 15, 10:40 am, "Bob Phillips" wrote:
What do you mean by paste to the cell below. The top left corner of the
pasted shape overlaps cell F9, at least in my testing it does.


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)


"Thomp" wrote in message


oups.com...


I know nothing about VBA programming so this may be simple for most.
I am trying to create a macro that once I click on the autoshape it
will copy and paste the object in the cell which I have select or
have
the pointer on. I can make it copy and paste to the cell below but
can't figure out how to make it paste to my active cell. I also
really
need in to delete the current autoshape that is in the cell.


thanks in advance


Here is the code


Range("F9").Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
Range("F9").Select
ActiveSheet.Paste- Hide quoted text -


- Show quoted text -


I just got part of it to work. It now copies and pastes to my active
cell but my only problem now is that there is an object or shape
already in the cell and I need to delete it first before I paste the
new object into cell


One important point the object name ("Autoshape 42") will change every
time so the code can't look for it by name but rather by the fact I am
in that active cell before I run the macro


thanks,
Bill
Here is the new code


ActiveCell.Select
Selection.ClearContents
ActiveSheet.Shapes("AutoShape 7").Select
Selection.Copy
ActiveCell.Select
ActiveSheet.Paste- Hide quoted text -


- Show quoted text -


Joel, I have some other shapes in the column that do not need to be
delete. Will this work as I only want the active cell to delete the
shape. I know this might be hard as I assume the actual shape does not
really reside in that cell?

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
Paste to active Cell Thomp Excel Programming 0 February 15th 07 04:04 PM
Macro to paste in the active cell the contents of a cell from another file?? LarryB Excel Programming 3 June 12th 06 06:37 PM
Copy from active sheet and paste into new sheet using info from cell in active Ingve Excel Programming 3 January 23rd 06 09:57 PM
Copy Paste from Active cell briank Excel Programming 3 June 6th 05 11:56 PM
Paste special to the active cell stakar[_20_] Excel Programming 2 August 17th 04 10:42 AM


All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"