VBA (Visual Basic for Applications) is the dominant programming language for Microsoft Office Applications [Word, Excel, Access...].
0
votes
1answer
13 views
Delete files from directory that are not in Excel spreadsheet
It's been awhile since I have done any Excel/VBA tricks. I have a directory of over 1500 image files and a spreadsheet list of about 900 filenames (basically it's a directory of every image that's ...
1
vote
2answers
20 views
Extract number sets from string, and return as comma seperated values in new string
Can anyone give me any pointers as to how to achieve this? I already managed to extract all numbers, but can't get them separated in the correct position. Hoping to achieve this through an excel ...
1
vote
0answers
15 views
VBA Run Time Error 13: Type Mismatch
My macro is a very simple replace program which identifies shortened parts of overall statements and replaces them with the full statement. For some reason I keep getting VBA error 13: Type Mismatch. ...
0
votes
0answers
5 views
VBA Macro If cell found in multiple cells then
i need help with the below if then statement. will try and explain as best as i can.
cells E21 and F21 is merged and the value varies. i have a list of numbers underneath each other from o1 to o100 ...
0
votes
1answer
13 views
excel: generate missing years of year range into one cell
I have a script that generates the 'gap' years within a year range (year_start <-> year_end - separate inputs) i.e. for 1997-2002, the script generates the following:
1997,1998,1999,2000,2001,2002 ...
0
votes
2answers
20 views
Looping through different ranges
I am working of a vba code to check cells in a retain range for criterium1. then i need to loop through other ranges to check for other criteria2,3,4... My range must then be variable. It loops column ...
0
votes
1answer
14 views
Inserting a row and manipulating values for the row
I am inserting a new row dynamically to my sheet With Row.Insert. I'd like to add some values in column B to that row I just added as in cell(my_new_row, 2).Value = myvalue. How can I do that?
Thanks!
...
1
vote
0answers
15 views
Add a Custom Group to Excel Ribbon in VBA
I'm looking around and I'm finding all of these nice pieces of code for adding custom buttons to the add-ins menu of the ribbon in excel 2010.
All I really want to do is add my own custom group to ...
1
vote
2answers
17 views
Import and Run Macro from text file
I'm trying to simply import a test macro into my current Excel Workbook. And then run the macro. I'm on Excel 2007. I'm getting the error:
Run-time error '1004':
Cannot run the macro 'DoKbTest'. The ...
0
votes
2answers
20 views
VBA Excel Import .txt with User-Input file name
I'm not sure if this is possible, but I would like to have a user enter the file name of a text file (not the entire C:\ thing, but just the name) that is to be imported into an excel spreadsheet. ...
0
votes
1answer
23 views
Object variable not set error
I'm an average VBA user and can't figure out why I'm getting an error.
Here is the code:
Set cell = AA.Sheets(sc).Columns("E").Find(Name, LookAt:=xlWhole)
If Not cell Is Nothing Then
...
-1
votes
1answer
14 views
macro pulling data from different file
I have a daily dashboard file in which I'm pulling data on a daily basis from 5 different files with a macro. The macro works fine but it is asking which file I should choose for specific steps: ...
1
vote
1answer
12 views
excel: generate missing years in year range either in VBA or function
I've been searching for hours for a function / vba macro solution to my problem - unfortunately to no avail... Maybe you guys can help?
I need to generate the 'gap' years within a range (year_start ...
1
vote
1answer
9 views
read text in userform label and add to worksheet
This is my first time posting, so please let me know if I've screwed up on any of the forum etiquette!
I have a userform which contains a label, two combo boxes and button. The text for the label is ...
0
votes
1answer
19 views
Open txt file, create new txt file, save old text to new file
I'm looking for code that prompts an OpenFile box for an existing txt file (file1), then creates and prompts SaveAs box for a new txt file (file2) for the contents of file1 to be saved in later.
It ...