|
-
Apr 19th, 2006, 05:48 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] Find Blank Excel Cells
I am trying to find out if the information in cell location is blank and if it is its fill the blank values with zeros. However with the logic I am using right now I never enter the inner part of the if check because its never blank.
However I know the values in those cells are blank is there any other way to check to see the value in the cell locations.
VB Code:
'Using Excel Reference determine how many columns are in the sheet.
For nCol = 1 To sheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Column
'If the row 6 and current column cell is blank
If sheet.Cells.Item(6, nCol).Equals("") Then
If Not (sheet.Cells.Item(4, nCol).Equals("")) Then
With Progress
For nRow = 0 To Me._accPeriod
'Displaying values from data into excel sheet.
sheet.Cells.Item(nRow + 6, nCol) = 0
sheet.Cells.Item(nRow + 6, 1 + nCol) = 0
.ProgressBar.Value += 1
Next nRow 'row increment
End With
End If 'None blank cell
End If 'Blank cell
Next nCol 'Total number of columns increment
-
Apr 19th, 2006, 08:16 PM
#2
Hyperactive Member
Re: [2005] Find Blank Excel Cells
 Originally Posted by Jumpercables
I am trying to find out if the information in cell location is blank and if it is its fill the blank values with zeros. However with the logic I am using right now I never enter the inner part of the if check because its never blank.
However I know the values in those cells are blank is there any other way to check to see the value in the cell locations.
VB Code:
'Using Excel Reference determine how many columns are in the sheet.
For nCol = 1 To sheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Column
'If the row 6 and current column cell is blank
If sheet.Cells.Item(6, nCol).Equals("") Then
If Not (sheet.Cells.Item(4, nCol).Equals("")) Then
With Progress
For nRow = 0 To Me._accPeriod
'Displaying values from data into excel sheet.
sheet.Cells.Item(nRow + 6, nCol) = 0
sheet.Cells.Item(nRow + 6, 1 + nCol) = 0
.ProgressBar.Value += 1
Next nRow 'row increment
End With
End If 'None blank cell
End If 'Blank cell
Next nCol 'Total number of columns increment
Why not try sheet.Cells.Item(6, nCol).Value="" instead of sheet.Cells.Item(6, nCol).Equals("")
-
Apr 19th, 2006, 08:19 PM
#3
Hyperactive Member
Re: [2005] Find Blank Excel Cells
If you want to know the value of the cell try typing these:
VB Code:
sheet.Cells.Item(6, nCol).Value
-
Apr 19th, 2006, 10:52 PM
#4
Thread Starter
Fanatic Member
Re: [2005] Find Blank Excel Cells
VB Code:
sheet.Cells.Item(6, nCol).Value
Apparently I missed that thanks guys and gals!
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
|