This question has to have a simple solution..
In this situation, the task is to search each row given column F, looking for cells that are blank. In the blank cell the words "No Comment" should be entered.
With the macro as it stands now, the VBA Counter is checking ever other row, i.e. 2,4,6,8; for the existence of blanks.
Where am I going wrong in getting this code to go through every line?
Thanks in Advance.
-Young
In this situation, the task is to search each row given column F, looking for cells that are blank. In the blank cell the words "No Comment" should be entered.
With the macro as it stands now, the VBA Counter is checking ever other row, i.e. 2,4,6,8; for the existence of blanks.
Where am I going wrong in getting this code to go through every line?
Code:
Sub FillBlanks()
Dim xlSurveySheet As Excel.Worksheet
Dim xlSurveyBook As Excel.Workbook
Dim SurveyLastRow As Integer
Dim SurveyQuestionFive As String
Dim SurveyRowCount As Long
fn = Application.GetOpenFilename("Excel-files,*.xlsx;*.csv", _
1, "Plateau Survey to Open", , False)
If TypeName(fn) = "Boolean" Then Exit Sub
Set xlSurveyBook = Workbooks.Open(fn)
Set xlSurveySheet = xlSurveyBook.Worksheets(1)
'Set xlSurveySheet = ThisWorkbook.Worksheets("SurveySheet")
' xlSurveySheet.Activate
' xlSurveySheet.Cells.Select
SurveyLastRow = LastCell(xlSurveySheet).Row
SurveyRowCount = 1
For SurveyRowCount = 1 To SurveyLastRow
SurveyRowCount = SurveyRowCount + 1
SurveyQuestionFive = xlSurveySheet.Cells(SurveyRowCount, 6).Value
If (xlSurveySheet.Cells(SurveyRowCount, 6).Value = "") Then
xlSurveySheet.Cells(SurveyRowCount, 6).Value = "No Comments"
Else
If (xlSurveySheet.Cells(SurveyRowCount, 6).Value > 0) Then
End If
End If
Next SurveyRowCount
End Sub
Thanks in Advance.
-Young