ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA coding (https://www.excelbanter.com/excel-programming/350624-vba-coding.html)

nir020

VBA coding
 
How can I declare a variable and then assign to a row so that it can be used
in a for loop?

Thanks

Norman Jones

VBA coding
 
Hi Nir20,

Dim rw As Long

For Each rw In Selection.Rows
'Processing code
Next rw


---
Regards,
Norman



"nir020" wrote in message
...
How can I declare a variable and then assign to a row so that it can be
used
in a for loop?

Thanks




Bob Phillips[_6_]

VBA coding
 
I think that should be

Dim rw As Range

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Norman Jones" wrote in message
...
Hi Nir20,

Dim rw As Long

For Each rw In Selection.Rows
'Processing code
Next rw


---
Regards,
Norman



"nir020" wrote in message
...
How can I declare a variable and then assign to a row so that it can be
used
in a for loop?

Thanks






Norman Jones

VBA coding
 
Hi Bob,

It certainly should!

Thank you,


---
Regards,
Norman



"Bob Phillips" wrote in message
...
I think that should be

Dim rw As Range

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Norman Jones" wrote in message
...
Hi Nir20,

Dim rw As Long

For Each rw In Selection.Rows
'Processing code
Next rw


---
Regards,
Norman



"nir020" wrote in message
...
How can I declare a variable and then assign to a row so that it can be
used
in a for loop?

Thanks









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

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