I have a macro code here that takes a range of text files from any given folder and imports them into different cells of an Excel Spreadsheet. However I need some editing done on this macro code so that it does what I need it to do. This is the macro that I currently use without any major problems. Sub ImportText() Dim fileRow As Integer Dim pathname As String Dim j As Integer, i As Integer, filenameLen As Integer [login to view URL] = False [login to view URL] = False filetoOpen = [login to view URL] _ ("Select Letter Files (*.txt),*.txt", , , , True) If IsEmpty(Range("A1")) Then fileRow = 1 Else fileRow = [login to view URL]( _ [login to view URL]).Row + 1 End If For i = 1 To UBound(filetoOpen, 1) [login to view URL] Filename:=filetoOpen(i), _ Origin:=xlWindows, StartRow:=1, _ DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, Tab:=False, _ Semicolon:=False, Comma:=False, _ Space:=False, Other:=False [login to view URL] [login to view URL] Set newBook = ActiveWorkbook 'reference to textfile [login to view URL] With Workbooks("[login to view URL]").Worksheets("Sheet1") [login to view URL] Destination:=.Cells(fileRow, 1) fileRow = .[login to view URL]( _ .[login to view URL]).Row + 1 End With [login to view URL] fileRow [login to view URL] Next i [login to view URL] = True [login to view URL] = True End Sub What I need this to do: 1) I need the macro to be able to be inserted on ANY spreadsheet. Currently it only works if I SAVE the spreadsheet as [login to view URL] (which you can see in the code above). It should be able to work on any open spreadsheet. 2) I need it to be able to paste the data according whichever cell I select as a starting point. Currently it only imports to Cell A1 and onwards. 3) I should be able to run this multiple number of times on any given sheet. Meaning if I wish to have data pasted on A3 and then subsequently R5, I should be able to do that. I am learning Excel, so kindly go easy on your bids since I won't be able to afford a lot. Thanks :)
Project ID: 2699745
Om projektet
13 anbud
Distansprojekt
Senaste aktivitet tolv år sedan
Ute efter att tjäna lite pengar?
Fördelar med att lägga anbud hos Freelancer
Ange budget och tidsram
Få betalt för ditt arbete
Beskriv ditt förslag
Det är gratis att registrera sig och att lägga anbud på uppdrag