Creating data with a loop based on current info in worksheet

I have an excel file (.xls) that already has data in it.

I have already got my VB app to open the source XML file and change it to a XLS file and delete the top row (blank and not needed) and add a new column in for my new data.

The new column needs to have data that will loop down until the other rows have no info. The naming will be generated based on a number.

vp0001.jpg
vp0002.jpg
vp0003.jpg
vp0004.jpg
and so on until it comes to the last row.

This data will be put into column A and it will check column B for the last row.

Thanks!



Answer this question

Creating data with a loop based on current info in worksheet

  • Le Saint

    that worked like magic!

    thanks


  • Carl Grainger

    Hello Dustinto,

    There are many experienced and learned people using this form and (I'm not one of them). But you have not really explained your problem in any detail that people can answer.

    If your column B has contiguous data then use the following.

    Sub test()
    Range("B1").Select
    Selection.CurrentRegion.Select
    rCount = Selection.Rows.Count
    End Sub

    rCount will contain the number of rows in column B.

    Chas


  • Cla82

    No one has any ideas


  • Montana Jones

    I have this almost done but I just need to know how to find the last row number so I can use it for the loop.

    I have it working now but you have to manually tell the program how many row to loop.

    Thanks


  • Creating data with a loop based on current info in worksheet