Why does this keep blowing chunks

  • Thread starter Thread starter Jon Turner
  • Start date Start date
J

Jon Turner

Dim oUsedRange as Excel.Range
Dim oRange as Excel.Range

oUsedRange = WorkSheets("Employees").UsedRange
For each oRange in oUsedRange <-- Blows up here with member not
found

Next


P.S. I'm using VB.NET so there is no SET statement

Many Thanks in Advance
 
Jon,

Your code should work as written. Try appending Cells to your
oUsedRange variable. E.g.,

For each oRange in oUsedRange.Cells


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
As the original poster indicated, he is writing in VB.NET, which
has no Set statement.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
I appended Cells but still does the same. Any other suggestions ? TIA

UsedRange = WorkSheets("Employees").UsedRange
For each oRange in oUsedRange.Cells <-- Blows up here with
member not found

Next
 
Programmer Error. Problem fixed.

How do I go about querying an individual cell in the WorkSheet.Range.Cells
collection ?
I want to find out each cell's value and column name.

TIA
 
oRange.Value

oRange.column

Not sure what a column Name is, but using integers has always been
sufficient for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top