ursalroberto
New Member
- Joined
- Mar 27, 2022
- Messages
- 12
- Office Version
- 365
- Platform
- 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
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