View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Identifying cell types in column using .SpecialCells(xlConstants, xlNumbers)

The obvious answer is that at least on of your four xxxPos variables has
an illegal value.

--
Regards,
Tom Ogilvy


"robbinma " wrote in message
...
Hello,

As part of the work I am doing I am trying to go through the columns in
a spreadsheet and identfiy the cell types using
SpecialCells(xlConstants, xlNumbers/xlText etc)

I specify the column to check using the following command:
toBeSpecdName = "my sheet"
set tempWs = worksheets.add

Set tempCellRange = Worksheets(toBeSpecdName).Range(Cells(rowStartPos,
colStartPos), Cells(rowEndPos, colStartPos))

where the variables are ints.

If I do the set tempCellRange command before the new worksheet is
created then it works but it fails if I do it afterwards it fails
with:
1004 Application error
and the debugger points at the Range command.

I aim to build a string that contains all the types in the column so
users can go and fix any columnns that have problems.

Anyone got any ideas?

Regards,

Mark


---
Message posted from http://www.ExcelForum.com/