I thought I had been able to use array to have more than two criterias with Autofilter, but now I am unable to make the following code work. What I am trying to do is have all the records that does not contain either N/A, S/O or xx and also have a filter on column 125 for the value "OUI".
VB: Sub test() Set ws1 = ThisWorkbook.Sheets("SOMMAIRE_EN_ALL") Set ws2 = Workbooks("Fichier_central_2013_anglais_2_CLEAN").Sheets("DETAIL_CONCAT") Set r = ws2.Range("A1:du4783")
I have 50 files each with 1000 numbers in column A.
I need to compare every list with every other list and calculate the Pearson function.
I am ok with the vb code to compare every file with everyother.
I can do this by opening each file then closing but it takes too long.
Each of the 50 csv file names is in my destination workbook
I would like to define an array using the file name, then extract 2 lists without opening the files then perform the pearson function and place the value in the destination workbook. (The pearson function just measures the strength of correlation between 2 sets of numbers)
I'm trying to open multiple files, pass them into an array and then work on them but the code below doesn't work (receive a Run-time error '9' message)
Public aFile As Variant
Sub MultipleFiles ()
MsgBox ("Please select multiple book files (holding CTRL as you click on flies) before you click open")
I have used macro to ftped a couple of files to my desktop and save them in a folder but i have problems performing the following.
1) Count the number of files in this directory "C:Summary_Reports_from_VBA". Note that the number of files is not fixed every time.
2) Rename each files to .txt files. (intially files do not have any extension and we do not know the name of the file until it has been ftped over but all files will end with a term "sorts" eg renaming of "xxxsorts" to "xxxsorts.txt")
3) Save each renamed files in an Array such that i can "opentext" each file in an excel worksheet. So if there's multiple files, there will be multiple worksheets.
i have this code which looks in a folder and moves all .csv files from folder into workbook. The code uses an Array.
If the code does not find a file in the folder (from the array) it returns an error. How can i modify this so that (if a file is not found from the array) then the code still continues without generating errors?
In every month I have to send report to each sales person provided one sales person should not get info of another sales person. Now I am doing it by making file after sort using copy and paste which is time consuming. Is there any way that I can make individual file for each sales person in shortcut way.
How do I create VBA macro to create CSV files out of Excel spread sheet for each tab? Right now I am manually opening the spreadsheet and saving each tab as CSV file. But it is taking lot of time if we have lot of tabs.
I need to create a macro that will allow the user to create a directory based on a template directory, with all directory paths/ names stored in workbook cells:
1) Create a new directory (name/path specified in workbook) 2) Go to a template directory & copy the entire directory, subdirectories & all files 3) Paste them into the new directory 4) Save a copy of the workbook into the specified location from (3)
Example: X:Templates -copy all to- X:Projects(Value specified in workbook cell)
Is it possible to create a VBA script that will list the filenames of files in a set directory? I have about 100 directories, each containing 1000 files and they need to go into an excel spreadsheet (each file on a new row)so they can be audited... ;(
I have an excel worksheet with data from A to T and the numbers of rows may change from use to use. I want to create a button/macro that determines where the data ends and will take the data from two columns, say column A and column D and put it in a new csv file.
In my final product, I would really like to be able to have a set of check boxes that say "Column D", "Column E", ... "Column T" and so if I check TWO boxes, say "Column D" and "Column T" and click create, it will output TWO csv files, one with Column A and Column D and the other with Column A and Column T.
I am trying to create an Array, and have searched through many threads on this website and realise I don't have a basic understanding of Arrays. Specifically the ReDim Array function.
1. Form Templete & 2. Student Data Index. (Both files will be placed in same folder)
About Form Templete : This is a simple form, containing some fields. Fields which i require are Form No., Student's name & Standard.
About Student Data Index : This file is to maintain records. Each time when I fill form for a new student i will copy paste the form templete file & rename it by form no. (Entered in the Form Templete file, Form No. field)
My question is : Is it possible that whenever i create a new file in the same folder with student's name the required fields in the Student data Index get filled automatically, apart from that the new file created get hyperlinked & when i click on form no. the form for that student gets open?
I have a excel file where I have the list of File Path in Column A & list of File names in Column B, Default path location is available in Column C. Now I want create a zipped folder based on the file name in Column B to the location Column C. I had browsed in Internet and found some code for creating the zipped file by selecting the files in Windows browser window. However my case is need to create the Zipped file based on excel cell contents.
I had found the code in the following location
Zip file(s) with the default Windows zip program (VBA)
create a code for creating the zipped folder based on Excel cell contents
I have a list of file names sans extension in column A. I want to search a folder I specify and if file is found create a hyperlink to said file either in a new cell or in column A.
The code I have does the search fine, but its hyperlinking is offset and I can’t get it to match the link to the file name.
I've written a program to read data into a custom table from ASCII files. The ASCII files are created from a VB script I've added to an Excel spreadsheet. The VB script in Excel is the following:
Private Sub Worksheet_Change(ByVal Target As Range) Dim str_fileName As String Dim int_fileNum As Integer Dim str_fileName2 As String Dim int_fileNum2 As Integer MsgBox "Testing" str_fileName = "\EPCOR02COLLECTSinto.txt" str_fileName2 = "\EPCOR02COLLECTDisa.txt" Application.EnableEvents = False If (Target.Address = "$D$2") Then 'Write to the Sinto file On Error Goto Err_CreateOutputFile int_fileNum = FreeFile...............................
On a multiselect listbox, is there any way the user can select a "block" of selections, instead of having to select them one by one? The list box I have has about 100 choices and it would be possible to select blocks of choices at a time. This is similiar to MS Outlook email where you can push the shift key to isolate a block of emails to move to a different folder.
I have a multiselect list box in a userform and need to transfer all the selected items in the list to Sheet2 Column D starting in the first empty cell.
I am using the following
Private Sub CommandButton1_Click()
Dim iListCount As Integer Dim iRow As Integer Dim rStartCell As Range
Set rStartCell = Sheet2.Range("D65536").End(xlUp).Offset(1, 0)
For iListCount = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(iListCount) = True Then ListBox1.Selected(iListCount) = False iRow = iRow + 1 rStartCell.Cells(iRow, 1).Value = _ ListBox1.List(iListCount, 0) End If Next iListCount Set rStartCell = Nothing
End Sub
My problem is that this is transfering just the first selected item from the listbox to the first empty cell in Sheet2 column D but the rest of the selections are not transfered.
I have attached a spreadsheet of data that I would like to reduce.
In the workbook there is a set of data (rows 1 - 24) which are defined with random dates (row 2) and number criteria column A.
In the table below that (rows 28 to 37) I have set out how I would like to present the data. how to create an array formula that sums the above data months into the criteria of column A.
I have an array which I would like to extract the information and put it in a table in a spreadhseet. Does anybody knows a faster or better way to do it different than using a for next?
As part of a larger formula, I need a way to evaluate a range row by row and generate an array with the results. More specifically, I need to evaluate whether at least one of the cells in a row has a specific value.
So given the following table:
1 1
1 2
2 1
2 2
3 3
When querying the table for the value "1", it should result in the array {TRUE, TRUE, TRUE, FALSE, FALSE}.
I have a folder with 20 Excel files. I'm trying to create a master list of all the tab names. I can see all of the files opening, but it only copies some of the names.
VB:
Sub GetTabNames() Dim wkBook1, wkBook2 As Workbook Dim stFilePath1 As String Dim FileList(1 To 18) As String Dim iLoopSheet, iLoopProg As Integer Application.ScreenUpdating = False
I have a MultiSelect Listbox with two columns of data and I want to enter the listbox row data into different cells of a sheet. For example, the selected listbox first column data to be entered to Sheet1, activecell and rows below (for other multiple selections), and the selected listbox second column data to be entered to Sheet1, activecell(0, 2) and rows below (for multiple selections).
I'm trying to return the selected items from a listbox to a range within a Worksheet when the user press the >> button as shown below. The point is i can't return ALL the selected items but only the first picked by the user.
Here is the code i'm using when button >> is pressed:
Code: Private Sub Inserir_Atributos_na_Analise_Click() Dim i As Long Set ws1 = Worksheets("ListBox")