View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Can I make a cell into a macro button?

try this. Copy into the SHEET module of the source sheet. Then, doubleclick
in col A to copy.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If target.column <1 then exit sub
with sheets("summary")
dlr=.cells(.rows.count,"a").end(xlup).row+1
sr = Target.Row
range(cells(sr,1),cells(sr,7)).copy .range("a" & dlr)
end with
End Sub


--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
right click sheet tabview codeleft windowworksheetright windowdouble
click or right click.

--
Don Guillett
SalesAid Software

"carl" wrote in message
...
I'm creating a number of worksheets within a workbook. These sheets have
data that is constantly updated and I often need to take the best line of
data from each sheet and copy it over to another sheet as a summary of
the
best data from each sheet.

Can I create a macro that is activated each time I click on a cell rather
than having to create a specific button. It's just that having buttons
doesn't work for what I need.

What I want is to be able to copy say cells A1:G1 to another sheet in the
work book. But the next time it might be A3:G3. And then the next time
A5:G5. Plus the tables that I'm copying from are sorted by price or by
date
using other macros so that adds to the complexity. So what I would like
is
to create a macro for each row so that when you click on cell A1 is will
copy
across A1:G1 to the sheet "summary".

The way I've done it up until now is create one single marco button that
will copy and paste columns A:G on the row that I've highlighted. So you
have to click on the row tab at the side and then click on the marco
button.
But it causes problems when you click on the marco button without
clicking on
the tab first.

This spreadsheet needs to be simple because it's being used by a lot of
people.