Hi again,
Managing dynamic ranges is easy once you know how. I'd advise you strongly to get familiar with range objects for a start. they are roughly analogous to a named range in 'standard' excel, but way more powerful - and let you see what is happening as you step through code.
to ID and capture the required range, you need to ID the first and last cell in the range.
You can use 'find' but for now, I suggest you use a loop so you can step through it and see how the code is responding.
something like
dim myRow as long
dim lastRow as long
dim myCol as long
dim lastCol as long
dim myRange as range
dim newSheet as worksheet
dim mySheet as range
' like to set all the main initialisation stuff in a block up front
set mysheet = thisworkbook.worksheets("Sheet 1")
mycol = 1
set newsheet = thisworkbook.worksheets.create
lastRow = mySheet.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row ' this is a fast and relatively error free way of finding the last row
'find the first row
for myrow = 1 to lastrow
if mysheet.cells(myrow,myCol).value = "KIT NO" then exit for
next myrow
if myrow > lastrow then 'debug - search string was not found
msgbox("debug 1")
exit sub
end if
'find last column. you can use the code for lastrow (change the searchorder), or
do until mysheet.cells(myrow,mycol+1).value = ""
mycol = mycol+1
loop
with mysheet 'the with statement makes the code easier to read - it applies to anything with a '.' in front
Set myRange = .range(.cells(myrow,mycol),.cells(lastrow,lastcol)
end with
now you can loop through your source data range ( for lRow = 1 to myrange.rows.count ) and copy selected row data into your new sheet
once this is done, google "Excel vba save as csv" and you should find the code to do this.
hope this helps
Werafa