Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can an image be related to a specific cell? 1

Status
Not open for further replies.

kragster

Technical User
Joined
May 9, 2007
Messages
55
Location
DK
Hi,
I am just finishing the work on a new ordersystem. The basics of the system is a row in the top of the sheet where users can input data. Then they press a submit button and the row is inserted into a table below. What I am thinking about making as a final touch, is a small button next to each row, that deletes that row. I have tried creating a small red cross and placed it to the right of the user input row. This way, when a user inputs new data and presses the "Submit Order"-button, the red cross is copy/pasted with the userinput. That's great! But how is it possible to know which of the rows to delete? If the image containing the macro was related to a cell it would be easy to delete the row of that cell. Is there any way for a cell to contain an image or otherwise relate images to specific cells?

Regards
Lars Kragh
 
Up. Can't anyone help me on this?
 
Maybe this thread707-1378314 could be useful for you.

combo
 



Hi,

Every Shape object on a Worksheet object, has a TopLeftCell and BottomRightCell property.

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
Hi Skip,
Yeah, I read the thread Combo referred to. It just seems a bit to complex for me contra what functionality it will provide, so I let it go. Thanks though.
 
You can have in standard module:
Sub ShapeClick()
Code:
MsgBox ActiveSheet.Shapes(Application.Caller).TopLeftCell.Row & " is the row"
End Sub
and a shape with above macro assigned to it.

You could consider an invisible shape as a template (with macro assigned) and 'Duplicate' method to get a handle to its copy. The copy can be made visible and moved do required destination.

combo


combo
 
Sorry, the proper code:
Code:
Sub ShapeClick()
MsgBox ActiveSheet.Shapes(Application.Caller).TopLeftCell.Row & " is the row"
End Sub


combo
 
Thanks a lot both of you. I will have a go at it later this week and get back to this post if I have further questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top