kscarlett5683
New Member
- Joined
- Feb 29, 2024
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
Hi, I have searched everywhere and cannot find a good answer to my problem. I am writing a VBA macro that, amongst other things, gets data from another workbook and then adds rows to the primary workbook's table. I have isolated the problem to literally just expanding rows to a table -- my code works fine without this step. Additionally, just running the expanding rows code crashes Excel. The script will add the rows, but as soon as you save or leave Excel, it shuts down and restarts automatically. My code is below. Does anyone have any idea how to fix this? I am using Windows 10 and Office 365. Excel 64 bit. Thank you
counterADR = 12
If counterADR > 0 Then
'resize the table instead of adding rows. Adding rows crashes the script.
tblTracker.Resize tblTracker.range.Resize(tblTracker.range.Rows.count + counterADR)
End If
startingRow = tblTracker.range.Rows.count - counterADR
P.S. The workbook I am using is quite small.
counterADR = 12
If counterADR > 0 Then
'resize the table instead of adding rows. Adding rows crashes the script.
tblTracker.Resize tblTracker.range.Resize(tblTracker.range.Rows.count + counterADR)
End If
startingRow = tblTracker.range.Rows.count - counterADR
P.S. The workbook I am using is quite small.