EXCEL-VBA (Visual Basic for Applications for MS-Excel) is the dominant programming language for Microsoft Office Excel.

learn more… | top users | synonyms

0
votes
0answers
4 views

Transpose data from a specific column from multiple sheets to rows on another 'summary' sheet

I have 79 sheets of data which are all the same format. I would like to copy data from a Column C6:C34 in to a Row in a 'Summary Sheet'. I have been successful in using the formulas mentioned in ...
0
votes
1answer
6 views

Updating a pasted a link to an external spreadsheet in VBA

I am trying to intercept the process of pasting an external link. I am wanting to change the source of the link to an internal web site. The formula looks like: ='[filename.xlsx]Sheet1'!$B$7 ...
0
votes
1answer
7 views

Convert from UCS2 Little Endian to ANSI in Excel VBA

In some tests I'm running at work, I have some automatically generated .htm files. I've been trying all day to parse the data and bring it into excel. I finally realized that the issue is that the ...
0
votes
1answer
16 views

Extract from multidimensional array

I have an array dat that shows Type = Variant/Variant(0 to 500, 0 to 0, 0 to 1) There is a "column" of dates: dat(0, 0, 0) = #1/1/2013# dat(1, 0, 0) = #1/2/2013# I want to extract this set of ...
0
votes
2answers
24 views

What is the Most Efficient Way to Append Several Lines to Excel Table Using VBA?

I am parsing an XML file and choosing/assigning values to a custom class list. What I'm doing now is looping through the list to append to an Excel table (listobject). Here is a simplified example: ...
0
votes
0answers
36 views

Only comments may appear after End Sub, End Function, or End Property

I keep getting the error: Only comments may appear after End Sub, End Function, or End Property When compling the following code: Option Explicit Private Sub ...
0
votes
1answer
16 views

loop through email in outlook using vba with descending date

I am using the below mentioned line of codes to loop through all the emails to find the one with specific subject line. However it always starts from the oldest one and is taking lot of time as mostly ...
0
votes
0answers
13 views

Comparing Two Worksheets and Updating

I'm trying to compare two worksheets in Excel using VBA. The Columns are exactly the same, with a different number of rows. Sheet1 will be compared to Sheet2 and updated based on the data in Sheet2. ...
0
votes
1answer
6 views

Type mismatch when trying to create a pivot table using vba with data range in another worksheet

Hello when trying to create a pivot table with the datasource being set a range within a different worksheet I am constantly getting either a type mismatch or a 1004 error depending on how I am trying ...
0
votes
1answer
14 views

Automate process by running excel VBA macro in SSIS

Recently, I have a project need to automate a process by combining SSIS package and excel VBA macro into one. Below are the steps: I have a SSIS package exporting all the view result to multiple ...
2
votes
2answers
35 views

Change value of a VBA constant

I have a function in which I set a VBA constant as follows: Const KEY_TEXT As String = "mycystomtext" Is there a way to change the VBA constant to a different text programmatically? I have tried ...
0
votes
1answer
9 views

Range activation in a different worksheet

I was wondering if there is an alternative for the following code: Dim Arr() as Variant Arr = Range("A1:I511") that refers to a specified worksheet. I tried the following Dim Arr() as Variant Arr ...
0
votes
0answers
17 views

How can I create a new excel file/Workbook in VBA without opening it automatically?

I created a subroutine to create a new Excel workbook based on an input string (the new file name). This is below: Private Sub AddSaveAsNewWorkbook(FILE As String) Dim path As String path = ...
0
votes
1answer
14 views

VBA send email from Excel using OFT template - Suppress automatic signatures

I've created a macro that opens an Outlook email template ready for the user to send (with some additional info pulled from the spreadsheet). All is going well except that Outlook is automatically ...
0
votes
1answer
8 views

How to import background color from HTML to Excel with VBA Macro

i try to get some information out of a table within a website by macro to an excel table. usually I just use ie2.ExecWB 17, 0 '// SelectAll ie2.ExecWB 12, 2 '// Copy selection and paste it to any ...
0
votes
0answers
6 views

Correct order of matrix operations with Excel VBA UDF?

I've written a handy function "MOperateMulti" in Excel VBA to do multiple matrix operations, e.g. D=A+B+C, just like Matlab/R can do. I can loop over multiple operators (+,-,*, etc.). The function ...
-4
votes
0answers
9 views

Running Excel 2010/VBA written on one computer and need to use it on another computer without path errors [on hold]

I have a series of Excel Worksheets with VBA commands and I would like to save and run them from the relative directory rather than the absolute path. That way when I execute them on a different ...
0
votes
1answer
26 views

Excel Macro: Print Date when there is a change in data

I'm trying to have my macro print out the date when my data is updated in column H. Also I need it to print in the same row of the update as well, so assuming I update A2, I want the date to be ...
1
vote
1answer
14 views

Hiding a column in conjunction with hiding a tab with VBA?

On Sheet 1, I have an array of individual columns that draw references from the respective tabs. So on Column 32, it will be referencing from Sheet 32. However, I don't need to see all the sheets and ...
0
votes
1answer
18 views

VBA navigating IE javascript link

First post. No idea how to do this. Never retrieved data from a website before. Can navigate through VBA to a page with options to open reports, but at this point everything goes from html to ...
0
votes
1answer
22 views

Update Excel Sheet Using SQL

I'm attempting to write a procedure that would use an ADODB connection to update records (rows) in a closed workbook. What I can't seem to figure out is how to reference multiple tables (worksheets) ...
0
votes
0answers
12 views

Email notification on submission (response) to Excel Survey

How can I receive an email notification every time a submission is made to an online Excel Survey?
0
votes
0answers
12 views

How to make combobox lose focus automatically

I have an excel workbook with multiple sheets and a have a home page where there are some hyperlinks which also lead to some tabs in the workbook.. I also have a combobox dropdown on the home page... ...
0
votes
1answer
23 views

Excel VBA using Find to update data in different worksheets

I'm trying to create a Macro that will allow me to compare data in two worksheets and update based on any differences (updates, insertions, deletions, etc.). This what I have so far - but it keeps ...
0
votes
1answer
39 views

Excel.exe*32 not closing in task manager. Runing VBA from Access. Runing Office 2013

The excel.exe*32 process remains open in the Windows Task Manager even though I am closing it in VBA. I am running the following VBA code from Access. I have looked and tried various solutions to no ...
-2
votes
1answer
36 views

VBA excel passing an array to sub fired by button

As in title I would like to pass an array to the sub which is executed by a button (That's why I don't know ho to pass it to the sub). Array is calculated in the Sheet before you can exectue sub with ...
0
votes
2answers
49 views

Excel VBA Application-defined or object defined error [on hold]

I'm struggling with this bit of VBA code. For some reason I keep getting: "Run-time error '1004': Application-defined or object defined error" message. My only thought on why this may be is that I ...
0
votes
2answers
20 views

Comparing two Cells in two different Worksheets

I keep getting the following error message when comparing two cells in two different worksheets: Run-Time Error '1004' Application-defined or Object-defined Error For j = 2 To 10 For k = ...
0
votes
2answers
17 views

Type Mismatch Run Time error 13 for excel VBA

I have requirement to write some function which will accept Range as input and I need to return value of first non empty cell. I have tried in one excel sheet and finding non empty cell was working ...
-7
votes
0answers
31 views

Have some quick queries on macro can you please help me? [on hold]

Please Help!!!!!!!!!! I need to copy paste file from one folder to another and then rename the files to present month and clear content in all the excel file and all the worksheets within it. Nextly ...
0
votes
0answers
19 views

store intersection column into array failed

I wanted to store some columns into array, so I use Union. Set ws = Application.Worksheets("data") k = ws.Range("a65536").End(xlUp).Row arr = Union(ws.Range("A2 :C" & k), ws.Range("M2 :N" & ...
-3
votes
0answers
27 views

Excel macro to generate sql create table [on hold]

Hi I need a help on the below scenario. I have a below excel sheet STUDENT S_NAME CHAR 10 1 STUDENT S_LAST CHAR 10 2 STUDENT S_GRADE CHAR 1 3 STUDENT S_MARK NUM 0 4 TEACHER T_NAME ...
0
votes
1answer
14 views

Importing dozens of xls files into Access

I have an excel spreadsheet that has 5 different tabs. I would like to create this spreadsheet in access represented by 5 different tables. My first attempt at this is to import in the files. I have ...
1
vote
1answer
29 views

xlLastCell only works half of the time

I am trying to remove the duplicates in excel via the following code: Set rng = Range("A1", Range("A1").SpecialCells(xlLastCell)) rng.removeduplicates Columns:=8, Header:=xlYes This method ...
0
votes
0answers
13 views

ActiveX component can't create object. Hasp in Excel VBA

I wanted to create object of HASP app in VBA in Excel, but I have such error: Run-time error '429': ActiveX component can't create object. I installed hasp_com_windows.dll in SYSWOW64 folder and ...
1
vote
1answer
22 views

Excel VBA OnTime for less than 1 second without becoming Unresponsive

I have a userform which runs a script every 100ms. The script handles images on the userform and is used to animate them, while the form continues to receive user input (mouse clicks and key presses). ...
0
votes
3answers
26 views

Debugging VBA code - appending values to array

I am trying to use code of the following form to populate an array of x rows: Dim myarray() As Variant Dim string1 As String Dim myarray_ubound As Integer myarray_ubound = 0 For i = 1 to x ...
0
votes
0answers
13 views

Add-ins not loading when opening excel file programmatically

I've seen some similar problems described by others before but no real solution. And I'm sure there is one. I have a .XLA-add in configured to be loaded when I open up Excel. It works fine when I ...
-3
votes
1answer
29 views

If A1 present in E:G, display E contents [on hold]

Kindly provide me a solution for this problem asap. I want A1 to be searched in cells E1, F1 and G1, if A1 is present in any of these mentioned cells, display the whole content of that cell in a new ...
0
votes
0answers
16 views

Need help in an excel Filter

My requirement is to make a filter such that if I select checkboxes 1,3 and 5 then it should return a single row with comma seperated values as 1,3,5 For eg I have the below data in a sheet. Name ...
0
votes
0answers
12 views

VBA QueryTables.Add fail to import text data in newly created sheet

Private Sub CommandButton2_Click() Dim MyFile As String Dim s As String Dim sheetname As String Dim curFile As String Dim dirpath As String Dim dirpathwild As String Dim ...
0
votes
1answer
44 views

Using Match function to copy rows with more than 1 criteria and incrementation

I had been trying to do matching of 2 criteria in a row on one worksheet and copy the whole row to another worksheet in the same workbook. As the loop goes on, the criteria will also increase like 1, ...
-1
votes
2answers
31 views

Excel.Application.Cells.SpecialCells(xlCellTypeLastCell) returning bottom of worksheet, not last data cell

I'm writing a method in VBA in Excel 2013 to loop through the rows in two worksheets and compare the text in a column from each. However, when I loop through, I'm finding that the code is looping ...
0
votes
1answer
17 views

Referencing cell containing filepath for sub

I'm using the following code to grab and resize a picture from file so I can print it out as part of a form. Private Sub CommandButton1_Click() ActiveSheet.Pictures.Insert ...
1
vote
0answers
42 views

VBA help for beginners

I have a excel macro with 2 buttons. When one is clicked certain rows are hidden and when the other one is click another selection of rows are hidden. My problem is that when I try to hide both ...
0
votes
1answer
47 views

Extremely slow VBA code when formatting cells

When attempting to format 2 columns in a workbook, the execution of the macro is extremely slow. To format approximately 4000 rows, it takes over 10 minutes. The dates are populated from an external ...
0
votes
1answer
28 views

Worksheetfunction in other sheet

I have copied and paste a code and it does not work properly. I have not changed anything and I am figuring out why it will not work. After a while i think I found the bug. I don't know how to fix it. ...
1
vote
1answer
31 views

Сondition on a cell that contains an IF stmt

I have cell A6 with a formula that looks for a content match of SS #'s in another cell B10 within a range of cells and displays the first record number if it there is a match: ...
0
votes
2answers
28 views

VBA to paste only values instead of paste every thing

I am working on a small project which requires me to search for a word through one column then copy the entire row that contains my word into another sheet. This is my code and what I have so far: ...
0
votes
1answer
49 views

Can someone help me optimize the VBA loop in excel

My worksheet have 6000 rows. This loop takes me more than 20minutes to finish. It is too long for me because I have many columns to run this loop. Can someone help me? Dim i As Integer For i = ...