Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get an error on this line where I try to reinstate Table1 to the Summary sheet
row 3 on down to last row of data. ..ListObjects.Add(xlSrcRange, Range("$A$3:$D$" & tRow), , xlYes).Name = _ "Table1" This line is used in another non-event code and works there. It is inside a With Sheets("Summary") statement in that code also. Thanks, Howard Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Target.Count 1 Then Exit Sub If Intersect(Target, Range("A:D")) Is Nothing Then Exit Sub If LCase(ActiveSheet.Name) = "summary" Then GoTo done If LCase(ActiveSheet.Name) = "begin blad" Then GoTo done With Application .EnableEvents = False .ScreenUpdating = False End With Dim aRow As Long Dim aRng As Range Dim tRow As Long, i As Long aRow = Target.Row Set aRng = Range("A" & aRow).Resize(1, 4) If Application.WorksheetFunction.CountA(aRng) = 4 Then With Sheets("Summary") For i = 1 To .ListObjects.Count .ListObjects(i).Unlist Next aRng.Copy .Range("A" & Rows.Count).End(xlUp)(2) '**** reinstate Table1 to Summary sheet ***** tRow = Cells(Rows.Count, "A").End(xlUp).Row .ListObjects.Add(xlSrcRange, Range("$A$3:$D$" & tRow), , xlYes).Name = _ "Table1" .ListObjects("Table1").TableStyle = "TableStyleLight2" End With End If On Error GoTo aft_error aft_error: With Application .EnableEvents = True .ScreenUpdating = True End With done: End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
OnTime Change_Event macro AND copy to sheet2 macro trouble | Excel Programming | |||
Web Login, Table1 | Excel Programming | |||
Cannot Dismiss the MsgBox | Excel Programming | |||
reinstate smart tag | Excel Discussion (Misc queries) | |||
Dismiss a dialog box (Via a Macro) | Excel Programming |