I am trying to do an automated import, the file I'm importing comes out of an application and in its properties just shows "file" so I can't use the standard text file methods. I originally recorded a macro for the automation and have tried to amend it.
I think it is falling over in the Destination stage, or maybe I need something instead of where the ". Name =" would normally go?
Private Sub All Files()
sFilename = Application _
. GetOpenFilename("All Files (*.*), *.*")
If sFilename <> False Then
With ActiveSheet.QueryTables.Add(Connection:=sFilename _
'.Name = "All Files"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
I need to import some spreadsheets that are sent to me into a master database spreadsheet. I have attached both below. The complaintstest.xls is the master database and the other is the sheet that will be imported. What I would like to happen is when the macro is run, the user will be able to select the sheet they would like to import through a dialog box. After the sheet is selected the macro will import the cells from the selected sheet into the master database in a particular order. In the master database example on row 2 I have listed the columns from the sheet to be imported in the corresponding column on the database sheet. This will macro will be run a couple of times a week so the macro will have to find the next empty row to start the import on.
I import into my website a standard .csv file that contains product details from my supplier. Columns contain info such as RRP, Wholesale Price etc and rows for each product. For some reason thats only known to my supplier the text descriptions of each of the products are held on a seperate .txt file, in a separate folder with the .txt filename recorded one of the columns cells, one for each product. There are 1000's of products, each with its own .txt file such as 38675.txt, 37828.txt. As you can imagine to copy and paste into each products cell or to manually import each .txt will take the rest of my life.
how I could automate the input of the diferent .txt contents into the required cells.
I keep a spreadsheet with the 50 or so wireless phones in our "lab". When someone checks them out, the rules are that they change the cell under Available to "NO" and add their user ID. When they return the device, they change the Available cell back to "YES". What I want is a log of who checked out the device, and when... which would be kept in "sheet 2".
I attached a small spreadsheet with the same columns and information you would see in the regular spread sheet. Sorry, I would rather have put it here, but I couldn't figure out how to do that.
The spreadsheet has code which updates the "Counter" when someone checks out a device. Many thanks to the "Rocket Scientist" who helped me with that.
find the attached file there is a form which i have created to update a data sheet, there are some fields in the Sheet which are there is the form, but what i want is in the form once i enter the data in first 2 to 4 fields 7th and 8 th, 9th ,10 th fields should updated based on some formulas given for caluclations:
See attached file: i want the following fields to get updated automatically
1) Tripcode should get updated as CONCATENATE of Cab type and trip type ( See Sheet "ATT" for formula i have mentioned)
2) Trip cost is based on trip if trip code is TTA then some value or if tripcode is TTB some value like that...
formula i have used in the sheet is...:- IF(J3="TTA","750")+IF(J3="TTB","700")+IF(J3="TTC","650")+IF(J3="TSA","750")+IF(J3="TSB","700")+IF(J3="TSC","650")+IF(J3="TQA","750")+IF(J3="TQB","700")+IF(J3="TQC","650")
3) Extra Kms Cost is field Extra Kms * 5(Some Value)
Right now I am constructing a macro so that upon exection, the user will be forced to select one of the dropdown menu options which are listed in a dynamic array. The dropdown menu should be in a popup of somekind created by the macro and not on any of the worksheets or charts. I would like to then assign the choice that the user makes to a variant. I have searched the web but not found what I am looking for and was hoping that someone could give me some phydocode that I can look at. The restrictions that I am operating by do not allow me to place a combobox upon any of the worksheets which is what I find in all the examples posted online.
I want to select the file name from the window which appear from the coding below,to be pasted in my textbox in userform.With only the coding below,I can only select my required file name(.txt) and afterwards, the file will be sorted into excel sheet.Before this,I set my Userform in such a way,user have to copy paste the path of the file into appropriate textbox.Itīs already functioned.I wish to alter the userform to be more user-friendly.Instead of copy paste the path,user can click the BROWSE button which I put next to the textbox,and the file can be selected.
Private Sub cmdBrowse_Click()
Dim b As Boolean b = Application.Dialogs(xlDialogFindFile).Show
The file should not have been sorted automatically because,user need to type in another inputs before running the process.
I am trying to create a form where a user can click a button and add a document to a workbook. The file(s) can be hidden on a seperate sheet, but ultimately should be displayed in a List Box or Combo Box. Not sure which would be better in this case. Selecting the item from the list would open the document (either through a double click functionality or a seperate button). I have the beginning of the code below.
Private Sub AddFile_Click() Dim vFile As Variant vFile = Application. GetOpenFilename("All Files,*.*", Title:=" Find file to insert") If LCase(vFile) = "false" Then Exit Sub Sheets("RefrenceSheet"). OLEObjects.Add Filename:=vFile, Link:=False, DisplayAsIcon:=False, IconLabel:=vFile End Sub
I have an excel file with multiple sheets. I want my HR team to update that file, but one user shouldnt see the entries of other users. I want to make a consolidated file out of three files. This excel template is for salary input.
I am running a macro which ends up showing the save as dialog box. The name is correct (data) and the type is correct (XML files) but no matter what I try the file path is not right. Here is the section of
Set fs = CreateObject("Scripting.FileSystemObject") Set js = fs.CreateTextFile(sDataFile, True, False) Set f = fs.GetFile(sDataFile) sFilePath = f.parentfolder & "" Set f = Nothing
How do I set the file path? I have already seen lots of answers to this but they are based on changing the path permanently or on there being no dialog box already open. I need total automation with the user not being able to see any of the save process.
I'm trying to find a way to import data from an external CSV file. I've used the import data function off the menu, so know how that works. However, I want to change how that works slightly by forcing the user to select a specific cell start the import at, as well as force certain of the options. Once the import is complete, I then need to fire off a custom macro. The only other option I can think of is to write a completely custom import screen, but I'd like to avoid that if possible.
Actually i've downloaded Tracking report of my SPO and this report is on 4-5 csv files (1 file per week). I have to gather data from these 4 files into one Worksheet. I have to do this with command button on my worksheet; with Open file dialogue box (i want to locate the csv files).
CSV files are something like that (I need only first 4 columns):
and my Worksheet is like that (With a command Button):
I want to import first 3 columns of csv file on first 3 columns on my worksheet; leave 2 columns blank and then import the 4th column... now for example i have done importing data from 1st csv file and the data is on 50 rows.. i click the command button again, locate the 2nd csv file.. do the same thing (import 1st 3 columns, 2 blank, then 4th) --from 51st Row-- and so on...
I have a workbook with many spreadsheet named Sheet1, Sheet2 and so on. Each sheet is filled completely upto 65536 rows. This data is being picked up from a CSV file. In this file there are sites with each site there is a assciated set of data. What happens is the data that extracts data does not differntiate between sites and when it reaches to the end of worksheet it splits the data into next sheet. So I am trying to create a macro to check each spreadsheet starting with the last sheet in the work book for example last sheet in the workbook is seven it should go to sheet6 and if there is a blank row after row 64000 it should cut all the rows and move them to sheet7. Then it should goto sheet5 and do the same and keep on doing it until it reaches sheet1.
An Excel file named CLEARING is availble in thr central server system. it will be accessed by 5 or 6 staffs from some other systems what i need is when one person accesses/edits this file the others should not even able to open in the read only file ,when the file is saved and closed ,then only the next person should access it
I'd like to know if it is possible to run a macro in a workbook that will open another workbook (of the users choice) extract data from it, such as columns from its sheets then paste that data into the workbook the macro is running from. The file to be opened will change, so i've found some code that enables the user to select the file to open then open it.
Dim strFile As String strFile = Application. GetOpenFilename If strFile <> "False" Then Workbooks.Open strFile
This brings up the standard windows choose file to open box, then opens the selected file. Am I correct in thinking that the Dim here will store the file name I select in the open file box? If so, I'd like to know how to select the workbook using the dim so I can manipulate it from the workbook I'm running the macro in. Incidentally, once the the data has been copied, I'd like the workbook opened with the macro to be closed.
I have a macro that works perfectly to import a text file and parse it. Now i need it to do multiple ones. I import the txt file to a new workbook as i filter for certain data only and if found i copy that to the current workbook. I want to do the same just for many txt files:
Below is the current code I have for File Copy before the workbook closes. This file will be distributed all over and obviously will not have the same old path and new path locations as I have in my code also will not have the same file name. Is there anyway to still perform the file copy without knowing the old path and file name and possibly have message box pop up to ask the copy to location and use that in the new path string?
Sub Macro1() Dim fs As Object Dim oldPath As String, newPath As String oldPath = "I:EXLDATAMC Daily" '<---Where the file is currently located newPath = "H:South RegionOrlando Mail Services2008DI" 'Since the super shared drive is super slow we will just copy and replace this file each time before we close and of course after we save Set fs = CreateObject("Scripting.FileSystemObject") fs.CopyFile oldPath & "" & "OrlandoMail.xls", newPath & "" & "OrlandoMail.xls" Set fs = Nothing End Sub
Microsoft (R) Windows Script Host Version 5.8Copyright (C) Microsoft Corporation. All rights reserved.
------------------------------------------ System Details ------------------------------------------ Host Name: XYZ CPU COUNT : 2 Total RAM: 4 GB ================= Disk 1 ================= Disk 1DeviceID: C: Disk 1Disk Size: 112GB =================
***** script completed - exit code: 0 *****
------------------------------------------ System Details ------------------------------------------ Host Name: XYZ1 CPU COUNT : 2 Total RAM: 4 GB ================= Disk 1 ================= Disk 1DeviceID: C: Disk 1Disk Size: 112GB ================= Disk 2 ================= Disk 2DeviceID: D: Disk 2Disk Size: 500GB =================
***** script completed - exit code: 0 *****
required excel format.
Host Name:| CPU COUNT: |Total RAM: |Disk 1 DeviceID:| Disk 1 Disk Size: | Disk 2 DeviceID: |Disk 2 Disk Size: XYZ| 2 | 4 GB| C | 112GB | | XYZ1| 2 | 4 GB|C | 112GB | D | 500GB
I am trying to import a file from a notepad to excel. I am trying to copy and paste in to excel. When I paste, all the info is in the same cell, although it looks that there is tabs between columns. Is there a way for me import those numbers into a spread sheet in different columns?......
I have a lot of txt. files you would like to imported automatically via VBA code text file is always the same need only certain data in these two rows which is the red just want this data
it is copied from txt. files in Excel so that I had with the click of a button you obtain all the information and through this button you looking for the folder in which the data next would have 2 lines one would be the computer name of one folder and the user can more This would also be the folder in which the data were computer name to the main folder subfolder, users, and wanted to let me read the particulars of which are in the name of the computer and the user. for example. computer name of the user
I recorded the following macro but it only imports files with a specific name. Can someone change the code to allow it open the specific file loaction where I may choose which .txt file I want to import.