VBA (Visual Basic for Applications) is the dominant programming language for Microsoft Office Applications [Word, Excel, Access...].
1
vote
2answers
23 views
How to concatenate text from a column into a new column? VBA Excel
I'm new to vba programming and I would like to work on a function to fix salutations in an excel file.
To start, I would just like to append a Dear " to a name in the first column, and put this ...
1
vote
1answer
13 views
Excel: delete entire row when other cell equals a defined value
I have seen (searched) similar examples, but not quite what I am looking for.
I have a Workbook in Excel that has several sheets, Sheet A and B. These sheets have a bunch of data, so in order to ...
0
votes
1answer
17 views
Verify excel or word is really running or not (has a open window) in the system
When we look at Windows Task Manager Process sometimes we see excel.exe or winword.exe is running, but there are no excel or word windows open in the system. But it's running in the memory.
How do I ...
0
votes
0answers
5 views
Method Range of Object Global failed error
I am new to vba and my first time working with "Select Case". I am receiving a "Method Range of Object_Global" error. I've checked through other postings but haven't been able to pinpoint the issue. ...
-1
votes
0answers
16 views
VBA Compare old string with new string and store each split line in a separate excel row I am using excel 2003
I am using excel 2003. I receive a big string of data every 2-3 minutes which is downloaded at Sheets ("result").Cells(4, 1) = tResult
I need to compared the old string called strsnip with the new ...
0
votes
1answer
12 views
Excel VBA - Select a dynamic cell range excluding headers
I'm trying to analyze huge amount of data in a spreadsheet. The records are being added,removed all the time. My headers are on the first rows, which I don't want to select. What I want to do is to ...
1
vote
1answer
21 views
Selecting two columns based on active cell?
I'm trying to do conditional formatting on a long range of columns in groups of 2. Im not sure how record a macro that would select the entire column from the active cell and the column next to it, ...
0
votes
0answers
22 views
vba searching columns in two documents
I have three Excel docs:
First: daily schedule (holds the plan for the days production)
Second: Method sheets (holds method sheets that have been produced for newer model units)
Third: a temp ...
0
votes
3answers
42 views
How to define an object inside a for loop for excel vba
I want to import data from multiple workbooks, all from the same sheet index (3).
I'm new to vba, and I figured out how to open multiple files up, and also to copy data from one sheet to another ...
0
votes
1answer
13 views
Trying to do a selection.replace with an xlUp
So I'm trying to to a variable range find and replace where I fill in blank spaces with "blank" for a row insertion where I drag down a row. All's I need is help fixing my xlUp so that it works with ...
0
votes
2answers
41 views
Sum up two columns from two different tables
I really need your help, I want to sum up the not empty cells in every appearance of the header of the column.
For example:
|111|222|333|111|444|222|555
aaa |2 |2 |2 |2 |2 |2 |2
...
0
votes
1answer
29 views
Looping through all available excel autofilter criteria one at a time in vba
I was wondering if there was a way to get all the different autofilter criteria in a list in order to iterate through each criteria, to in the end copy and paste each different table that would appear ...
0
votes
1answer
28 views
Excel Macro to search folders and return files containing specific keyword and most recent version
I am looking for some help on writing a macro that will search a folder in my computer to see if any of the files in the folder contain a specified keyword, then return the file name, path and last ...
0
votes
0answers
15 views
Need some help automating a few steps using excel macros
I'm playing around with the macro recorder but I can't get it to do exactly what I'm trying to accomplish. I'm basically repeating 7 steps:
Copy list of names from external source (SharePoint)
Paste ...
0
votes
0answers
17 views
How to fill in a dynamic combination of numbers into an array
In my Excel worksheet users can enter 1 to 5 rows of data in the form of minimum, maximum and step size values. I want to create an multidimensional array that has all the combinations of the data.
...
0
votes
1answer
45 views
If sheet doesn't exist, create it (VBA Excel)
I am importing data from Microsoft Access, the error detection doesn't seem to be working. If the code tries to create a sheet that already exists, keep going and set the destinationsheet to the ...
2
votes
1answer
44 views
Allow user to kill process during wait in VBA
I have written a program to print multiple .pdfs with varying file extensions off of an Excel spreadsheet list.
The problem is that it takes anywhere from 30 seconds to a minute for the printer to ...
-2
votes
0answers
19 views
VBScript to list Nodes from Google Geocding api into excel sheet
I am trying to list all Google Geocode xml nodes and values in Excel Sheet. Can anyone help with this? Trying with VBScript and Xpath
The sample output
Formatted address 21, houston,....
Lat 19.2345
...
0
votes
1answer
19 views
Determine range encompassed by merged cells
Given a merged cell in Excel, is it possible to determine with VBA what rows the merged cell includes? I found this answer, but that only returns the number of cells included in the merged cell; I ...
0
votes
2answers
40 views
How to split dates with VB in Excel
Facing such a problem when hadling with excels again...
I have an excel table with such cloumns
People Date
-------------------------
A 01/01/2013 - 05/01/2013
B 03/05/2013
C ...
1
vote
0answers
7 views
vba excel connections query tables delete
in a bigger Excel application, (25 sheets, 50 command-buttons, 5000 lines of code, 18 userforms ... size 12 MB) ... we load tables from a server as txt files and reconvert these txt_files to excel ...
1
vote
1answer
12 views
Create repeat excel macro code until no more text mentions
I have created this macro code using the record function.
Sub Macro1()
'
' Macro1 Macro
'
'
Cells.Find(What:="Text to find", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, ...
0
votes
2answers
22 views
Excel: How can I add code to a lost focus Event of a cell?
Is there a way to add code to the LostFocus event of the cells in a sheet?
I want to add code to keep the first 50 characters of the cell that loses the focus:
If Len(ActiveCell.FormulaR1C1) > 50 ...
1
vote
1answer
45 views
Excel VBA Run-time error 13 Type mismatch
i get a runtime error 13 during compilation. this is the line that throws up an
error, y = Application.counta(("A:A") <> "" - 3). I tried declaring y as a variant/ () didn't help either. could ...
0
votes
1answer
15 views
Import MS Access Database Query into Excel using VBA without Login Prompt
I am trying to import an MS Access query into excel without triggering the log-in prompt. I have attempted this operation a few different ways, but both methods haven't given me a complete solution.
...
0
votes
1answer
26 views
Excel VBA StrCmp sub or function not defined
I am trying to use the StrCmp function in excel vba (using excel 2007) and am getting the following error:
Compile Error:
Sub or Function Not Defined.
Here is my code:
...
1
vote
1answer
28 views
How to get object method (object.“something”), where method name comes from a list of strings (“something” is a string)?
I have a user form that contains lables. (I have to manually create each lable, since I can only place it in the correct spot by looking at the underlying image.) Each lable must go through the same ...
0
votes
0answers
50 views
Checking if a access table exists in Excel vba( dlookup or using sql)?
how to check if table exist and if it doesnt exist create table in sql server 2008
The link above I think shows what I am trying to do using sql in excel vba. I should say I don't really know sql, ...
0
votes
1answer
19 views
Import an excel table in a access file USING OFFICE 2010
i'm a newbye I have a problem with the vba code to import data from a table in excel file access. Using Office 2010, but the launch of the code gives me an error:
(translate from Italian)
run-time ...
0
votes
1answer
31 views
Make Connection to AS400 in Excel to update 2 worksheets with data from 2 Tables?
I have an Excel workbook with several worksheets. I need to connect to AS400 and make it to where when users click refresh, 2 worksheets ([Feedname] & [Feedprod]) are updated with data from 2 ...
3
votes
0answers
38 views
PrintOut prints groups of sheets instead of 1 group
We have this problem on many workbooks where we select a few sheets with VBA and print them using the following line and Excel will actually print multiple groups of pages instead of 1 group of ...
0
votes
0answers
21 views
Extract data from closed workbooks and enter into another workbook [closed]
I have looked for some VBA code to help me.
I want to be able to search an unlimited number of closed workbooks, saved under job numbers, for the result of worksheet ('Details' D12). This is an ...
0
votes
1answer
30 views
VBA Code to filter rows by date and then copy to master sheet
I have a workbook with multiple sheets and a master sheet. I would like to search through all of the sheets and select rows with dates in column A that are 120 days old or older and then copy those ...
1
vote
1answer
21 views
selecting max value excel using Cells(x,y) as input
How do you call the Max function in VBA using a range of Cells (x,y) as input?
E.g., I have two variables, m & n, where n > m
I try to find the Max value within a range of cells using the ...
1
vote
2answers
63 views
Need assistance with Macro - Excel
I have a =SUMIF formula that needs to be adjusted each time the macro is run. The 3rd part of the formula, the sum range, needs to shift over 1 column each time. I will be running this once a month ...
0
votes
2answers
39 views
Copy One Sheet To Different Workbook…But Paste Values?
Thanks for all you're help. I've figured it out and have successfully come up with code to carry out what I needed. I have one more question, and hope you'd be able to help. Attached is my code, pay ...
0
votes
1answer
25 views
“Object required” error VBA
I've got a Worksheet titled "Survey". I'm trying to attach checkboxes to all of the cells in column A that are next to answers, and for some reason I'm getting an "object required" error. The 4 lines ...
0
votes
1answer
26 views
excel vba sorting currency column descending
I have a sheet with 2 columns A has shopnames and B has currency values
I want to sort in descending order column B
Here's what I have done:
With Sheets("helpsheet")
.Sort Key1:=Range("A"), ...
1
vote
1answer
24 views
VBA: How to delete filtered rows in Excel?
I have an Excel table that contains some data. By using next vba code I'm trying to filter only blank cells in some fields and delete these rows
ActiveSheet.Range("$A$1:$I$" & lines).AutoFilter ...
1
vote
3answers
30 views
Excel VLOOKUP N/A error
I have a table setup like this:
I am trying to do a lookup, where Column D value matched one of the Column A values and returns Column C value.
The numbers in column A and D are stored as text.
...
2
votes
2answers
32 views
How can I color dots in a xy scatterplot according to column value?
Consider the following worksheet:
A B C D
1 COMPANY XVALUE YVALUE GROUP
2 Apple 45 35 red
3 Xerox 45 38 red
4 KMart 63 50 ...
-1
votes
1answer
26 views
Paste specific text in Column J If Specific Text Appears in the same row in column G
So for example I have an excel sheet where column G has the text "Measurement Type" on numerous rows and I would like the text "dec-fb-control-chains.jpg" to appear in the same row but in column J ...
0
votes
3answers
35 views
Copying columns from one sheet to another
This Macro works fine, but I know it's not efficient and there has to be a better way to do it. How I can avoid having to .Select the sheet?
Sub ReportFormatter()
Columns("BS:BS").Select
...
0
votes
2answers
20 views
Unselect button inside macro
I have created an excel macro that takes a horribly formatted table and for the most part puts all the data in the correct place. So instead of retyping out the data manually which would take 8+ ...
0
votes
0answers
23 views
Deserialization does not work when dll is called from EXCEL, only works when called from vb.net application
I got stuck with my problem. I created a dll with visual studio 2012 with vb.net. The dll has an interface cDialog. When I create an instance of cDialog, I can open the dialog with the Show method:
...
3
votes
1answer
42 views
Two random numbers sticking together
I'm trying to write a function that changes 3 coordinates and 3 velocities in a loop using random numbers.
Although he generated numbers seem random enough. The two last values never drift apart, ...
1
vote
1answer
43 views
Protect excel with password from vba
I want to design VBA code that protects excel document with password.
I know its possible with excel tools and its more secure, but I want to try this and use it in other projects.
I wrote this code ...
0
votes
0answers
22 views
How to call a DLL from VB with pointer to array
sorry if this is a silly question, but I'm a newbie in C and VB.
I would like to use a dll written in c++ inside a vba function.
My aim is to pass an array to the dll function, and have its items ...
1
vote
1answer
10 views
Handling error in Pivot source update
I have create macro to change the source of Pivot in all worksheets. In my workbook there has sheets one with CityName, like 'Mumbai'(Which is pivot sheet) and source data sheet with Name ...
2
votes
2answers
89 views
VBA: Copy number from a string of text and insert into cells below
I want to create a makro in Excel which performs - after pressing a button - the below. I attached some dummy data that is formatted like the actual sheet.
There are several data blocks that are ...