I get the "Run-time error '9': Subscript out of range" error when running my macro from a Button assigned to my macro, but if I run my macro from the ribbon it works fine. (When I debug, it says the problem is with the "LastRow =" line. Don't understand why.
Table256 is the only table and only data on the Members tab - my row is successfully added to my table
I'm running this on a mac ... Looking for some help to understand problem
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 ; background-color: #ffffff }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008f00 ; background-color: #ffffff }p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: #ffffff ; min-height: 13.0px}span.s1 {color: #011993}</style>Sub GetLastRow()
Dim sht As Worksheet
Dim LastRow As Long
Set sht = ActiveSheet
Sheets("Members").Select
ActiveSheet.ListObjects("Table256").ListRows.Add AlwaysInsert:=True
LastRow = sht.ListObjects("Table256").Range.Rows.Count
End Sub
Table256 is the only table and only data on the Members tab - my row is successfully added to my table
I'm running this on a mac ... Looking for some help to understand problem
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 ; background-color: #ffffff }p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008f00 ; background-color: #ffffff }p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; background-color: #ffffff ; min-height: 13.0px}span.s1 {color: #011993}</style>Sub GetLastRow()
Dim sht As Worksheet
Dim LastRow As Long
Set sht = ActiveSheet
Sheets("Members").Select
ActiveSheet.ListObjects("Table256").ListRows.Add AlwaysInsert:=True
LastRow = sht.ListObjects("Table256").Range.Rows.Count
End Sub