Results 1 to 10 of 10

Using a macro to add code to a newly created workbook.

Threaded View

Alagard Using a macro to add code to... 12-03-2010, 04:27 PM
mrice Re: Using a macro to add code... 12-03-2010, 04:46 PM
jaslake Re: Using a macro to add code... 12-15-2010, 04:59 PM
Alagard Re: Using a macro to add code... 12-16-2010, 01:08 PM
jaslake Re: Using a macro to add code... 12-16-2010, 01:34 PM
royUK Re: Using a macro to add code... 12-16-2010, 02:34 AM
Alagard Re: Using a macro to add code... 12-16-2010, 01:55 PM
snb Re: Using a macro to add code... 12-16-2010, 05:08 PM
royUK Re: Using a macro to add code... 12-16-2010, 06:05 PM
jaslake Re: Using a macro to add code... 12-16-2010, 06:08 PM
  1. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Using a macro to add code to a newly created workbook.

    sub snb()
    activeworkbook.vbproject.vbcomponents(1).codemodule.AddFromText replace(replace("Option Explicit||Private Declare Function sndPlaySound32 Lib ~winmm.dll~ Alias ~sndPlaySoundA~ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long||Private Sub Worksheet_Change(ByVal Target As Range)|Dim Cell As Range||If Not Intersect(Target, Range(~B:B~)) Is Nothing Then|For Each Cell In Intersect(Target, Range(~B:B~))|If Range(~D~ & Cell.Row) = ~NOPE~ Then|sndPlaySound32(~C:\windows\media\notify.wav~, 1)|Exit Sub|End If|Next Cell|End If||End Sub","~",chr(34)),"|",vbCrLf)
    End Sub
    Last edited by snb; 12-16-2010 at 05:11 PM.



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1