DerekK
Board Regular
- Joined
- Jun 18, 2007
- Messages
- 90
- Office Version
- 2003 or older
- Platform
- Windows
I'm testing out some VBA on a sheet with only two rows: one row for headings, one row for data.
My VBA includes a For Each statment with a CurrentRegion property but the code seems to search the entire sheet, rather than just the "CurrentRegion." I know this because I've included an If Then statement with Else MsgBox "Not applicable" and it seems to want to display this message a full 65,536 times!
Therefore, might "CurrentRegion" include any formulas, as I have formulas copied all the way down to the last row? If so, how do I make sure the For Each applies only to rows where I have actual data?
If not, then what might be the problem?
Hope you can help...
-Derek
My VBA includes a For Each statment with a CurrentRegion property but the code seems to search the entire sheet, rather than just the "CurrentRegion." I know this because I've included an If Then statement with Else MsgBox "Not applicable" and it seems to want to display this message a full 65,536 times!
Therefore, might "CurrentRegion" include any formulas, as I have formulas copied all the way down to the last row? If so, how do I make sure the For Each applies only to rows where I have actual data?
If not, then what might be the problem?
Hope you can help...
-Derek