修改程序代码,多谢
修改程序代码,谢谢~
修改一下程序代码,谢谢!!!!
自动填充上一个单元格的公式,因为公式是vlookup,可能有空值,一旦遇到空值就无法继续填充了,请问怎么继续往下填充,谢谢!
Dim j As Integer
Dim thissheet As Worksheet
Dim sheetname As String
Dim i_flag As Integer
Dim columns_to_fill As String
Dim thiscolumn As String
i_flag = 0
sheetname = InputBox("Please input the name of the worksheet" & Chr(13) & Chr(10) & _
"where you want to fill in blank cells.", "")
If Trim(sheetname) = "" Then
Exit Sub
End If
'To check if the worksheet with this name exists
For Each thissheet In ThisWorkbook.Sheets
If UCase(thissheet.Name) = UCase(sheetname) Then
i_flag = 1
Exit For
End If
Next
If i_flag = 0 Then
MsgBox "There's no worksheet with name '" & sheetname & "' in this workbook!"
Exit Sub
End If
thissheet.Activate
columns_to_fill = InputBox("Please input column(s) in which you need to fill:" & _
Chr(13) & Chr(10) & "(if you have several columns, separate by "","" )", "", )
columns_to_fill = Trim(columns_to_fill)
If columns_to_fill = "" Then
Exit Sub
End If
'Loop with columns one by one
Do While columns_to_fill <> ""
If InStr(columns_to_fill, ",") > 0 Then
thiscolumn = Left(columns_to_fill, InStr(columns_to_fill, ",") - 1)
columns_to_fill = Mid(columns_to_fill, InStr(columns_to_fill, ",") + 1, 100)
Else
thiscolumn = columns_to_fill
columns_to_fill = ""
End If
thiscolumn = UCase(thiscolumn)
If (Len(thiscolumn) = 1 Or Len(thiscolumn) = 2) And _
修改一下程序代码,谢谢!!!!
自动填充上一个单元格的公式,因为公式是vlookup,可能有空值,一旦遇到空值就无法继续填充了,请问怎么继续往下填充,谢谢!
Dim j As Integer
Dim thissheet As Worksheet
Dim sheetname As String
Dim i_flag As Integer
Dim columns_to_fill As String
Dim thiscolumn As String
i_flag = 0
sheetname = InputBox("Please input the name of the worksheet" & Chr(13) & Chr(10) & _
"where you want to fill in blank cells.", "")
If Trim(sheetname) = "" Then
Exit Sub
End If
'To check if the worksheet with this name exists
For Each thissheet In ThisWorkbook.Sheets
If UCase(thissheet.Name) = UCase(sheetname) Then
i_flag = 1
Exit For
End If
Next
If i_flag = 0 Then
MsgBox "There's no worksheet with name '" & sheetname & "' in this workbook!"
Exit Sub
End If
thissheet.Activate
columns_to_fill = InputBox("Please input column(s) in which you need to fill:" & _
Chr(13) & Chr(10) & "(if you have several columns, separate by "","" )", "", )
columns_to_fill = Trim(columns_to_fill)
If columns_to_fill = "" Then
Exit Sub
End If
'Loop with columns one by one
Do While columns_to_fill <> ""
If InStr(columns_to_fill, ",") > 0 Then
thiscolumn = Left(columns_to_fill, InStr(columns_to_fill, ",") - 1)
columns_to_fill = Mid(columns_to_fill, InStr(columns_to_fill, ",") + 1, 100)
Else
thiscolumn = columns_to_fill
columns_to_fill = ""
End If
thiscolumn = UCase(thiscolumn)
If (Len(thiscolumn) = 1 Or Len(thiscolumn) = 2) And _