3
I’m running a macro to import txt data. But this macro is bringing the information down after a white line
(9 Rows(s) affected)
The data information is correct, but it has this line that I need the macro delete.
This via VBA code.
Edited: macro code based on the comments
    Sub XPTO()    
        With ActiveSheet.QueryTables.Add(Connection:= "TEXT;Z:\42\Promessas_diarias_AES_RC_20150304_210000.txt", Destination:= Range(Selection.Address))
           .Name = "Promessas_diarias_AES_RC_20150304_210000" 
           .FieldNames = True 
           .RowNumbers = False 
           .FillAdjacentFormulas = False 
           .PreserveFormatting = True 
           .RefreshOnFileOpen = False 
           .RefreshStyle = xlInsertDeleteCells 
           .SavePassword = False 
           .SaveData = True 
           .AdjustColumnWidth = True 
           .RefreshPeriod = 0 
           .TextFilePromptOnRefresh = False 
           .TextFilePlatform = 1252 
           .TextFileStartRow = 5 
           .TextFileParseType = xlDelimited 
           .TextFileTextQualifier = xlTextQualifierDoubleQuote 
           .TextFileConsecutiveDelimiter = False 
           .TextFileTabDelimiter = True 
           .TextFileSemicolonDelimiter = True 
           .TextFileCommaDelimiter = False 
           .TextFileSpaceDelimiter = False 
           .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1) 
           .TextFileTrailingMinusNumbers = True 
           .Refresh BackgroundQuery:=False 
       End With 
       ActiveWindow.SmallScroll Down:=6 
       Range("F569:L570").Select 
       Selection.ClearContents 
       Range("F569").Select 
   End Sub
   Sub OptionPane() 
       MsgBox (Selection.Address) 
       MsgBox Day(Date) 
       MsgBox Month(Date) 
       MsgBox Year(Date) 
   End Sub
What macro is this?
– ramaral
Post the code of your macro
– Lucio Rubens
With Activesheet.QueryTables.Add(Connection:= _ "TEXT;Z: 42 Promessas_diarias_aes_rc_20150304_210000.txt", Destination:=Range _ (Selection.Address)) . Name = "Promessas_diarias_aes_rc_20150304_210000" . Fieldnames = True . Rownumbers = False . Filladjacentformulas = False . Preserverveformatting = True
– Vinicius Samuel Quevedo
.Refreshonfileopen = False . Refreshstyle = xlInsertDeleteCells . Savepassword = False . Savedata = True . Adjustcolumnwidth = True . Refreshperiod = 0 . Textfilepromptonrefresh = False
– Vinicius Samuel Quevedo
.Textfileplatform = 1252 . Textfilestartrow = 5 . Textfileparsetype = xlDelimited . Textfiletextqualifier = xlTextQualifierDoubleQuote . Textfileconsecutivedelimiter = False . Textfiletabdelimiter = True
– Vinicius Samuel Quevedo
.Textfilesemicolondelimiter = True . Textfilecommadelimiter = False . Textfilespacedelimiter = False . Textfilecolumndatatypes = Array(1, 1, 1, 1, 1, 1, 1) . Textfiletrailingminusnumbers = True
– Vinicius Samuel Quevedo
.Refresh Backgroundquery:=False End With Activewindow.Smallscroll Down:=6 Range("F569:L570"). Select Selection.Clearcontents Range("F569"). Select End Sub
– Vinicius Samuel Quevedo
Sub Optionpane() Msgbox (Selection.Address) Msgbox Day(Date) Msgbox Month(Date) Msgbox Year(Date) End Sub
– Vinicius Samuel Quevedo
I’m sorry, but I was only able to put in the fractional code. Need that after imported the TXT file that is updated daily it sends the necessary information leaves a blank line and then on the line below (9 Rows(s) affected) <- I want to delete this guy Please help me
– Vinicius Samuel Quevedo
Do not put the code in comments. Edit the question to insert the code into it! :)
– Luiz Vieira