LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default Some macros not working on shared workbook

Hi all,
I'm sharing a workbook but one of the macros isn't working:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Const WS_RANGE As String = "J:J"
Dim rng1 As Range
Dim rng2 As Range

If Target.Cells.Count 1 Then
Exit Sub
End If

If Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Exit Sub
End If

Set rng1 = Target.EntireRow.Range("A1:J1")

With Worksheets("outcomes")
Set rng2 = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
End With

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Value < "" Then
With rng1
..Copy _
Destination:=rng2
..Delete Shift:=xlUp
End With
End If
ws_exit:
Application.EnableEvents = True

End Sub

This one copy/deletes a defined row of data to another sheet when J:J
changes (it has a validation list of blank or yes).
I have a few other macros in the workbook such as opening at a specific
sheet, highlighting selected rows, two useforms adding data to the next
available empty row etc and these all work fine.

Any ideas why the one above doesn't?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code not working on Shared Workbook KC_Cheer_Coach Excel Worksheet Functions 3 April 7th 09 06:09 PM
shared workbook - macros using advanced filter - substiitution nee Belinda7237 Excel Worksheet Functions 1 June 5th 08 02:29 PM
Macros in Shared Workbook Matt Excel Discussion (Misc queries) 6 September 13th 07 08:36 PM
Shared Workbook not working jazztpt Excel Discussion (Misc queries) 0 May 27th 07 12:24 PM
activesheet.tab.colorindex not working when workbook shared Martin Appleton Excel Discussion (Misc queries) 0 July 21st 06 08:45 AM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"