how to continue the table count

ursalroberto

New Member
Joined
Mar 27, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm looking for some help to populate another Table No. based the No. Of table Range("B3") , currently the default value is 2 and if I want to change into 3 or 4 and so on it will be added the new Table No. 3 and four data and the Value End will be the last row always when I will be going to add new Table.
I'm using this code but ain't working
Dim cell As Range

Range("A1").End(xlDown).Select
For table = Range("B2").Value To 1 Step -1
For RowNdx = 3 To lastRow Step 96
Rows(RowNdx).Insert
Cells(RowNdx, 1).Value = "Data"
Rows(RowNdx).Insert
Cells(RowNdx, 1).Value = "Data"
Rows(RowNdx).Insert
Cells(RowNdx, 1).Value = "Data"
Rows(RowNdx).Insert
Cells(RowNdx, 1).Value = "Data"
Rows(RowNdx).Insert
Cells(RowNdx, 1).Value = "Table No. " + CStr(table)
Next RowNdx
End If

Next table

1652928803967.png
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,215,268
Messages
6,123,965
Members
449,137
Latest member
yeti1016

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top