ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advice on With-End With (https://www.excelbanter.com/excel-programming/428577-advice-end.html)

kirkm[_8_]

Advice on With-End With
 
Hi,

I'm reading 11 columns in several hundred rows, processing them and
writing them back to a different sheet.

At the moment each value is assigned to a variant and after finishing
each row, they're sent to a function and and written to the other
sheet.

This lets me use one 'With' clause in the main routine and one
in the function.

I could write each one as it's done though, and wouldn't need to
assign a variant, nor call a function. Instead I'd need a pile of
nested 'With' loops.

Which way is best, please ? Or is it insignificant?

Thanks - Kirk

Tim Williams[_2_]

Advice on With-End With
 
It's not clear what your current code looks like, or why an alternative
might require lots of nested for loops, so it's difficult to suggest which
approach is "best".

Best performance or best maintainability ? If the run time is not noticably
different then maintainability should trump.

Tim

<kirkm wrote in message ...
Hi,

I'm reading 11 columns in several hundred rows, processing them and
writing them back to a different sheet.

At the moment each value is assigned to a variant and after finishing
each row, they're sent to a function and and written to the other
sheet.

This lets me use one 'With' clause in the main routine and one
in the function.

I could write each one as it's done though, and wouldn't need to
assign a variant, nor call a function. Instead I'd need a pile of
nested 'With' loops.

Which way is best, please ? Or is it insignificant?

Thanks - Kirk




Don Guillett

Advice on With-End With
 
Perhaps you should post your code for comments

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"kirkm" wrote in message ...
Hi,

I'm reading 11 columns in several hundred rows, processing them and
writing them back to a different sheet.

At the moment each value is assigned to a variant and after finishing
each row, they're sent to a function and and written to the other
sheet.

This lets me use one 'With' clause in the main routine and one
in the function.

I could write each one as it's done though, and wouldn't need to
assign a variant, nor call a function. Instead I'd need a pile of
nested 'With' loops.

Which way is best, please ? Or is it insignificant?

Thanks - Kirk


kirkm[_8_]

Advice on With-End With
 
On Sat, 16 May 2009 16:02:26 +1200, kirkm wrote:

Thanks guys.... I couldn't impose my code on anyone though!
As well as bad it's extremely complex!

I'll leave it as is... it's fast enough and does what's required :)

Cheers - Kirk


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com