RE:parar la macro si nohay datos en archivo extern
ok me referia a como devo escribir la condicion If para lo siguinte:
Sub Macro1()
'
' Macro1 Macro
'
'
if C:Documents and SettingsxpMis documentosF5.txt = "(nada)" then
msg reviza archivo de entrada '
exit sub
else
Range("A1").Select
ActiveCell.FormulaR1C1 = ""
Range("A1").Select
Selection.End(xlToLeft).Select
Selection.End(xlUp).Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:Documents and SettingsxpMis documentosF5.txt", Destination:=Range _
("$A$1"))
.Name = "F5"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(4, 7, 7, 6, 10, 11, 13, 8, 6, 8, 6, 6, 8, 6, 5)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
end if
End Sub
NOTA: LA CONDICION IF SE QUE ESTA MAL PERO COMO DEVE IR.