View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Newt Newt is offline
external usenet poster
 
Posts: 8
Default Use shape location to clear cells

Actually neither. I was hoping to link the code via a macro to an autoshape
drawing object. If I must use controls, I would prefer to use the Control
toolbox. Thanks.

"Ron de Bruin" wrote:

Do you use controls from the Forms or Control toolbox

--
Regards Ron De Bruin
http://www.rondebruin.nl



"Newt" wrote in message ...
I had tried to use some similar code previously, but in both cases get a Type
mismatch error. I'm using Excel 2003 if that matters. Any ideas? Thanks.

"Ron de Bruin" wrote:

Hi

Try this

Dim rw As Long
rw = Range(ActiveSheet.Shapes(Application.Caller).TopLe ftCell.Address).Row
Range(Cells(rw, "A"), Cells(rw, "D")).Select


--
Regards Ron De Bruin
http://www.rondebruin.nl



"Newt" wrote in message ...
I would like to use a series of shapes to clear cells on a worksheet. For
example:

Shape1 exists in Cell A1. When clicked, it clears cells B1 and C1
Shape 2 exists in Cell A2. When clicked, it clears cells B2 and C2

and so on.

I need the references to be relative because I regularly re-sort the sheet
and the order of the shapes changes with all the cells. Basically, I want a
sub to figure out where the image is located and then clear the two adjacent
cells. Any ideas? Thanks!