|
-
May 8th, 2006, 03:16 PM
#1
Thread Starter
Member
Read the formating of an excel column?
I'm having to read a spreadsheet, and depending on if the column is indented or not, store the value.
If the field's formatting is indented, I ignore it, it if isn't, I store it.
I read the field's value like this...
VB Code:
myVariable = exll.Worksheets(TabName).Cells(12, 1).Value.ToString
But how can I read how the field is formatted??
So it would end up something to the effect of ...
VB Code:
if ( exll.Worksheets(TabName).Cells(12, 1).FORMAT_IS_CORRECT ?? )then
myVariable = exll.Worksheets(TabName).Cells(12, 1).Value.ToString
else
myVariable = "Skipped Value"
End If
-
May 8th, 2006, 03:20 PM
#2
Re: Read the formating of an excel column?
You cna look at the "AddIndent" property of the cell. If this property is TRUE, then the cell is indented, if FALSE it isn't.
VB Code:
If exll.Worksheets(TabName).Cells(12, 1).AddIndent = False Then
myVariable = exll.Worksheets(TabName).Cells(12, 1).Value.ToString
Else
myVariable = "Skipped Value"
End If
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
May 10th, 2006, 09:19 AM
#3
Thread Starter
Member
Re: Read the formating of an excel column?
.AddIndent always returned false. I think it has to do with the way production formatted the spreadsheet, but I'm not sure.
I'm using .IndentLevel and it is working well.
I appreciate the help.
-
May 10th, 2006, 09:34 AM
#4
Re: Read the formating of an excel column?
Hmmm, are you sure the cells are truely indentred, or could it be that they have leading spaces?
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|