Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From VB.Net(2003) I want to be able to iterate through all cells "c", in a
runtime defined range object(excel 2003). However, when the xTest sub is run, it generates a member not found error on the line( for each c in objrange.cells). Any help would be greatly appreciated. Thanks Rick declarations Private objExcel As Microsoft.Office.Interop.Excel.Application Private objWorkbook As Microsoft.Office.Interop.Excel.Workbook Private objRange As Microsoft.Office.Interop.Excel.Range function xTest(strSomeRange as string) as variant Dim c As object objExcel = New Microsoft.Office.Interop.Excel.Application objExcel.Visible = True objWorkbook = objExcel.Workbooks.Add() objRange = objWorkbook.ActiveSheet.Range(strSomeRange) For Each c In objRange.Cells ' this is where the error occurs. 'some code goes here and sets a format based on the cells content Next c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Iterating files in folder | Excel Worksheet Functions | |||
Iterating through string in a cell | Excel Discussion (Misc queries) | |||
iterating checkboxes | Excel Discussion (Misc queries) | |||
iterating through all properties of an object | Excel Programming | |||
Iterating through row cells on column Match, help please. | Excel Programming |