Column Increment in Excel-exporting

Hi We can increase a row of excel for exporting the data by a counter(like n=n+1) in Lotus script.So that the data can be exported accordingly.

Is there is some was to increment the Column.I don’t have fix no of columns to be exported in my report.It can be 10 columns ,it can be 20 columns also.I need to increase the Columns programitically,like once the data in column A is exported then it should move to column B,it don’t want to hard code the columns in my script for example

excelApp.sheets(1).range(“E” & Cstr(n)).value = doc.crby(0)

Subject: Column Increment in Excel-exporting

Check the Sandbox and/or OpenNTF.org. There are examples for cycling through columns so you can use the same code in any view.

You may also want to take a peek at Alan Lepofsky’s blog - he as a snappy little example in his latest ‘tips and tricks’ blog post.

HTH

Doug

Subject: Column Increment in Excel-exporting

The same as you are incrementing a counter for the row you can also increment a counter for the column. Then to set a value for a cell you would have a formula similar to:

excelApp.sheets(1).cells(rowCounter, colCounter).value = doc.crby(0)

Subject: RE: Column Increment in Excel-exporting

it don’t wark for column,it gives error,because rows are numeric and columns are not numeric

Subject: RE: Column Increment in Excel-exporting

Columns are numeric if you want them to be. If you address a cell through the Cells collection, you get numeric row, column addressing:

worksheet.Cells(row, col).value = myValue

Subject: RE: Column Increment in Excel-exporting

How can we use row and column counters in my sheetexcelApp.sheets(1).range(Cstr(N) & Cstr(M)).value = “IT Personal/Categories”

It’s giving OLE error while exporting

Subject: RE: Column Increment in Excel-exporting

Did you read my post? I GAVE you the code already.

Subject: RE: Column Increment in Excel-exporting

Thanks Stan,Your Logic works fine