MultiSelect Files - How To Properly Create Array
Aug 28, 2013
I got the following code:
Code:
Function DateiAuswaehlen() As Variant
Dim FileOpen As Variant, i As Integer
Dir Left(KonvPath, InStr(KonvPath, ""))
[Code]...
Basically, I want the function to return an array, but also work when the user does not choose any file.
View 1 Replies
ADVERTISEMENT
Oct 12, 2012
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")
[Code] .....
View 3 Replies
View Related
Apr 2, 2014
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)
View 4 Replies
View Related
Feb 17, 2010
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")
aFile = Application.GetOpenFilename(FileFilter:="Excel (*.xl*), *.xl*", _
Title:="Select required book level files", MultiSelect:=True)
Dim i As Integer
For i = LBound(aFile) to UBound(aFile)
Workbooks(aFile(i)).Activate
'Do something, then repeat with next file in array
Next i
End Sub
View 9 Replies
View Related
Apr 9, 2012
I am making a report with product usages for a given week. There is a file for each week.
At the moment I am using vlookup function and manualy change path to source file every week.
=VLOOKUP($A$1,'A:FilingDataMatrix 2012Production Matrix[Production Matrix 2012-Week15.xlsm]Mon - Ingredients'!$E:$F,2,FALSE)
Now I would like to avoid the part with manual changing. Instead I would like to have an ability to take the file path from separate cell.
View 2 Replies
View Related
Dec 12, 2006
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.
View 11 Replies
View Related
Jul 27, 2008
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?
This is the ....
View 9 Replies
View Related
Jun 11, 2013
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.
View 1 Replies
View Related
Jan 27, 2010
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.
View 14 Replies
View Related
Jun 26, 2007
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)
View 3 Replies
View Related
Oct 20, 2007
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... ;(
View 3 Replies
View Related
Apr 9, 2008
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.
View 5 Replies
View Related
Dec 20, 2006
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.
View 2 Replies
View Related
Apr 28, 2009
I have two files,
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?
View 11 Replies
View Related
Mar 26, 2014
Any way to create individual excel files for over 300 people in one shot.
I have created an excel template and have a list of 300 people. Rather than one at a time, is there a way to do it in one shot?
View 2 Replies
View Related
Jul 28, 2014
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
View 2 Replies
View Related
Feb 18, 2009
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.
Also it breaks if it can not find the file.
Here is the code...
View 9 Replies
View Related
Dec 3, 2009
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...............................
View 2 Replies
View Related
Mar 17, 2006
I've found countless, very useful macros that do 1/3 of what i need. My needs:
1) A macro to look in a set network folder, and generate a list of Excel files, and display them (1 per row, just the file name if possible)
2) Each file name is a hyperlink to open that sheet
3) A macro to look at the file listed above, then list in the column B a value from a set cell. So it would ideally output:
1| RH0018.xls A1CellValue
2| RH0019.xls A1CellValue
3| RH0020.xls A1CellValue
View 2 Replies
View Related
Oct 9, 2009
I have a sheet named "Main" and multiselect listbox in this sheet.
I've named the multiselect listbox "Test", in the window just above the column A, next to the formula/cell value input field
However when trying to run a macro which is to return the selections in the multiselect listbox. I get an error i the VBA code that "object required".
View 13 Replies
View Related
May 2, 2006
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.
View 2 Replies
View Related
Jan 30, 2007
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.
View 7 Replies
View Related
Jan 25, 2013
I have a doubt, in VBScript for excel is possible create an associative array?, for example:
PHP Code:
Dim columnValue(26) As Variant    columnValue("A") = 1    columnValue("B") = 2Â
So if I want to know the value that corresponds to the letter B the result must be: 2
MsgBox columnaValor("B")
View 2 Replies
View Related
May 24, 2014
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.
View 5 Replies
View Related
May 15, 2014
Array set for workbooks? I have more than 10 workbooks to update
refer to attachment. the VBA code is in Consolidation SOP.
View 13 Replies
View Related
Jan 6, 2009
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?
View 2 Replies
View Related
Apr 15, 2014
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}.
How can I achieve this?
View 4 Replies
View Related
Jul 26, 2013
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
[Code] .....
View 2 Replies
View Related
Jul 23, 2009
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).
View 2 Replies
View Related
Apr 28, 2014
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")
[Code].....
View 7 Replies
View Related