View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default write vba to a worksheet via a macro

Hi
You probably need to use the SheetBeforeDoubleClick within the
ThisWorkbook module. This gives you the option of passing it the sheet
where the doubleclick applies.
Something like:

Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal
Target As Range, Cancel As Boolean)
If Sh.Name = "b" then
'your current code
endif
End Sub

regards
Paul

On Jan 4, 9:06*pm, joemeshuggah
wrote:
i have a macro that deletes tabs a, b, c, and then re-creates them with the
current information i enter into tab d. *

i have a worksheet (beforedoubleclick) procedure that i want to incorporate
into worksheet b...but the procedure is deleted each time the macro is run
because the deletion of worksheet b is part of the macro.

is there a way for the macro to write the beforedoubleclick procedure to
worksheet b after it has been deleted and re-added?