Identify row number of the data in a listbox

dss28

Board Regular
Joined
Sep 3, 2020
Messages
165
Office Version
  1. 2007
Platform
  1. Windows
I have a listbox which is filled with data transferred from textboxes in the userform and not from sheet. The listbox has multiple rows and columns.
I have also added a code to delete a row before final saving of the data to excel sheet.

Hence if I try to give / add a row number through a textbox in the userform to rows, it might get altered if the user deletes any of the rows before final saving the data to sheet.

e.g. if initially I transferred data in 5 rows to the listbox1, with Sr. No. 1 to 5 assigned to them through a textbox, but then decide to delete 3rd and 4th row so finally it will have only three rows numbered 1st, 2nd and 5th (now 3rd after deletion of two row) to save to the sheet. Here the sequence of row number is not proper. I want to save them as Sr. No. 1, 2, 3

My idea is to assign row number by any code to these three final rows so that the same can be captured in one of the columns (say ColumnH) in the sheet. is it possible?
Can anyone help..
 
that's a great learning on this small code ...
I appreciate everybody's efforts and fulfilling my imaginations on coding........
thanks a lot Norie
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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