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
1answer
5 views

Cutting a column and then inserting with excel vba

Columns("DV").Cut Columns("P").Insert Shift:=xlToRight I am using this code above to basically move a column, but every time I run the macro it slows the process so much. Is there a more efficient ...
0
votes
0answers
10 views

Using VBA to connect Access to Excel, will not output any records from Access

I would like to connect to my Access tables using VBA. I want to be able to type in a purchase order number, and reference that value in a query to the Access table. I want to print the results of ...
0
votes
1answer
19 views

Why am I getting this error: Object Variable or With block variable not set?

I have found out what causes this error but I cannot pinpoint where it is coming from in my code. I even tested this macro in a separate worksheet in excel and it worked but in this worksheet it is ...
-2
votes
2answers
18 views

Split Data from column or row to worksheets office 2007

Hello guys how are you?I have the follow problem, i have an excel book, and a sheet with 3 columns like that And i have only one worksheet, now i want to choose for example the data from column a ...
0
votes
0answers
25 views

Compile Error: sub or function not defined: why?

This issue has been written about but I have trouble relating the solutions to my own code: Public Sub myArray() Dim row1(3) As Integer row1(0) = 6 row1(1) = 4 row1(2) = 8 Dim x ...
1
vote
0answers
22 views

How can I reference only the row from a variable in a For Each loop? VBA

I wrote a Macro to copy data from multiple .xls files into a single spreadsheet in this workbook. This Macro works fine and is not included in this question. This workbook has a predefined list of ...
-1
votes
0answers
11 views

VBA to Autofill Single Online Field

New to the form here. I was going to continue with things the hard way, but a friend who contributes persuaded me to ask my question here. I am trying to do a simple pilot project to help me become ...
0
votes
0answers
14 views

Stuck trying to write VBA program to apply formatting based on certain conditions [on hold]

I am completely lost trying to write code to apply formatting based on certain conditions in VBA because I have never attempted to do this before. Can someone share with me how they would solve this ...
-1
votes
0answers
15 views

Excel, create named range for x amount of rows based on cell value and then start process again

I have some data with around 30 columns and 3000 rows I want to create a named range that uses the amount of rows specified by a number in a cell, and then move onto the next relevant cell in a ...
-1
votes
0answers
6 views

Pulling pdf files from internet explorer

I've been trying to download pdf files from internet explorer using an excel macro. I've been using two methods but neither of them works perfectly, if I could get help in either one of them I would ...
0
votes
0answers
11 views

FormulaR1C1 — 1004 run-time error, Application or object-defined error

Getting 1004 error trying to run the following line. I'm pretty sure its the string at the end. Sheets("PositionData").Activate Range("H6:H9").FormulaR1C1 = "=RC[-2]-RC[-1]" 'trouble line (the ...
-1
votes
0answers
8 views

Google Maps/Earth: Get color of coordinate location of KML layer

I would like to ask your help with the following: I have 2 data sources: (1) An Excel file with coordinate locations (2) A KML layer with wind speed data ...
0
votes
0answers
13 views

vba worksheet loop won't loop through more than 11 worksheets

After some research, I found this code from Santosh. It's exactly what I need. However, it gets stuck on 'Next' if I have more than 11 worksheets. I have 80, and I've tried different sets of more than ...
0
votes
0answers
16 views

18 Day rolling average

Just after some kind guidance please. I have a spreadsheet that I need to calculate a rolling 18 day average. This is based of the date from a .txt file imported into Excel. I currently use this ...
1
vote
1answer
28 views

Example of VBA array being passed by value?

I thought that arrays were always passed by reference in VBA, but this example seems to be an exception: ' Class Module "C" Private a_() As Long Public Property Let a(a() As Long) Debug.Print ...
0
votes
0answers
9 views

Excel Macro very slow

I have a macro that is a series of "if" statement and when it Sub Test() For i = 2 To NumRng Select Case Worksheets("Sheet2").Cells(i, 2) Case "NTP Issued", "Submitted to Contracting", ...
0
votes
1answer
18 views

Is it possible to store reusable VBA code in a library and call from Outlook?

I have code written in Outlook 2010 VBA that I want to share with co-workers (an Outlook rule runs that calls the code, which saves the current e-mail to a network folder as a text file). What I ...
0
votes
2answers
21 views

Excel VBA running a function on every cell in a row with a dynamic range

I would like to run a function called ToNum on every cell in a row with a value that will convert a cell contents to a string. Here is my code below but I am getting a compile error, can anyone assist ...
1
vote
1answer
14 views

Excel VBA--Insert blank line in lotus notes email body

I am looking to insert a blank line into the body of a lotus notes email. For example: Currently my body displays this: "Hi this is the body of my email. <img></img>" And I want the ...
0
votes
0answers
15 views

Excel - Macro to run Word Mail Merge from Excel Data

Afternoon, I've got a VBA code that in theory should pick up the active workbook and use the data to open a Word Document and leave the mail merged document open ready for review/saving. It worked ...
2
votes
0answers
17 views

Last item in multiselect listbox only partly visible

I have an excel sheet with multiple listboxes. All of them multi-select. As excel always messes up the dimensions of the listboxes i had a piece of code to repair them when opening the workbook: ...
-3
votes
1answer
38 views

Excel VBA - Concatenate Rows with duplicate KEY values

I have a very large set of data in the following format: Before I'm brand new to VBA, but I'm working towards conforming this data so that it can be entered into SPSS. For our purposes, it needs ...
-3
votes
1answer
17 views

Need Concept to create a function using array or whatever you suggest- in sql server

Below is the example of Data. ss-tt(1/21/2014 9:47:12 AM)->bb-tt-uu(02/07/14 11:09:59) Above data is store in a column of a table. Now what I want to do ,to split "date" which is followed by ...
0
votes
1answer
26 views

Rounding up a cell value to the next multiple of 10 (not just nearest 10)

I am using a Formula Array in cells H2 and H3 in Sheet2 (say) but using VBA coding. What I need to do with these values is round them both up to the next multiple of 10. I do not want them just to ...
1
vote
2answers
46 views

Converting hours and minutes stored as text to minutes only using VBA

I have a column containing different amounts of time, ie 1hr, 2hr 30 min, 30min etc. I need to convert these into minutes. My idea is to check the number of characters and then do a delete. For ...
0
votes
0answers
9 views

pivot chart with different axis, show all in vertical with vba

I created a pivot table and a pivot chart. This pivot chart has 2 values in the X axis (month and name). The problem that I have is that the month appears in vertical but the name appears in ...
0
votes
2answers
26 views

Selecting one column from each row in a table

I have a table structured (Table Name: Table2) like below: Using VBA, I want to select ONLY a single column value of the current row by iterating over each row. Here is the code and I wrote: ...
1
vote
2answers
15 views

Formula Autofill down multiple columns, using specific cells in VBA

Specific cells: K4 and K8 Columns with data needed for formulas: A (values named devm), C (values named slice) and D (values named point) Columns with formulas to go in: E, F and G (want to name ...
1
vote
0answers
19 views

VBA Solver disabling the dialog box that pops after each iteration

I am using the built-in solver in Excel 2007 within a VBA loop to solve a number of different problems. Occasionally, the solver hits the maximum time, which causes a pop-up dialog box to appear ...
3
votes
1answer
21 views

Command button to open file - file path located in the same cell button is aligned to

I'm trying to get a single macro that I can assign to my command buttons. I have multiple buttons that open different files so in each cell I include a different file path. Currently my command ...
1
vote
1answer
29 views

Is it possible to have an InputBox decide which column for my code to look at

I have looked for this everywhere but can't find an example of it. I have a code which searches a column and deletes all rows that contain the exact value within that cell. I want to make this a ...
-1
votes
0answers
9 views

Add images into excel with file size economy [on hold]

I have an excel file with a lot of images. Lots of images make my file very heavy. Is it possible to add and show images by link? Add a link to image is not a problem, but I want to see all images ...
-2
votes
0answers
11 views

create a chart from filtered table [on hold]

I'm trying to create a chart from a table which is filtered. I want excel to generate one chart for each element of one of the filters. Since I have 60 different elements I need excel to create the ...
-2
votes
0answers
13 views

VBA Export XML - get outputfile and store as string variable?

I'm using the export xml in excel. I need to build a more complex XML file. What I figured was, I build a table of just "items" which could easily be built by excel by just using the export xml ...
1
vote
1answer
49 views

excel vba permutations exceed 1048576 rows

I'm trying to create a permutation list in excel for 6 numbers, each in their own columnA-F and each number is from 1-38. when i run the VBA i find that the permutations far exceed rows 1048576 ...
-4
votes
1answer
31 views

How to find merged cell somewhere in row [on hold]

I have merged cell somewhere in row. How to find it Sorry. It's very new for me thank a lot
0
votes
4answers
42 views

Excel, advanced data consolidation

I have several very large data sets that I need to consolidate. These data sets come from different studies, so the formatting etc is disparate. What I would like is a macro that can search for a ...
-1
votes
0answers
15 views

Dropdown list with criteria repetition

I have a list of conference, where in Sheet1, column A ', will be entered only cods that are on Sheet2, column A' more with a criterion can only be repeated a total of times is in Sheet2. To enter ...
-3
votes
0answers
12 views

VBA range Chartobject and forloop inquiry [on hold]

Happy Labor day!! Despite it's a holiday, I am stuck with working on some codes that are needed for tomorrow and was wondering if you guys can help me out. The code below works completely fine but ...
2
votes
0answers
36 views

My macro does not return desired results from a web query

I am new to writing macros, and I have been working on a macro that uses the name of a LLC in a worksheet and searches a website (using their API) for the best matched LLC and returns that company's ...
-2
votes
0answers
17 views

Refer formula from another worksheet [on hold]

How Do I do this? Select contents from "Column I" from sheet named "Data" Select Distinct values from this column and then transpose it and paste in another sheet called "ClassCount" in the cell D to ...
0
votes
1answer
23 views

Turn off / ignore message box's in excel

Is there any way of turning off or ignoring message boxes which have been programmed into a user form? I have tried Application.Displayalerts=False however, this only seems to apply to excel error ...
1
vote
1answer
23 views

Adding content of a cell into a string variable in VBA. Also, adding cells below it using offset

I have a simple function that is going to pull from a specific Cell (N4). If there are cells below it then it will loop and collect all the content of the cell and separate with comma. I'm getting ...
0
votes
1answer
13 views

copy lots of sheets and delete a few sheets

I was wondering if someone could help me with the code. I am almost there but not fully. Sub col_export_Klikken() Dim wb As Workbook countsheets= ThisWorkbook.Sheets.Count Set wb = Workbooks.Add ...
0
votes
1answer
20 views

copying columns from selected rows to another sheet vba

the user should choose some rows (not necessarily beneath each other), then some columns from each row will be copied to another sheet, how can I achieve this ? I have tried application.inputbox , ...
0
votes
1answer
34 views

LIKE comparison of a different kind

Background I am working on a game analysis software where I have to convert sentences into what I call "sentence templates" and match those sentence templates with standard templates which are stored ...
0
votes
0answers
12 views

MSXML2.XMLHTTP in the background - Skip waiting for response

I have some tools created in Excel that I created for my less technical colleageus to be able to input data to our database and to be able to also save the data locally for their own use. The data is ...
0
votes
1answer
35 views

VBA Error: "Run Time Error '424' Object required when attempting to .getElementById

I continue to get the above error when running this code. I have tried dozens of web searches and adjustments to fix but unsuccessful. The code is below and any help if very much appreciated. Public ...
0
votes
3answers
31 views

VBA SQL query strings, how much is supported?

still working on a query for a project and my partner has managed to come up with a nifty SQL statement what works wonders when run but wont seem to work in VBA and it has got me questioning how much ...
-4
votes
1answer
37 views

How do I select columns with certain values in excel? [on hold]

I want to select all columns with a value of Saturday or Sunday using either VBA or just somehow in excel. That way I do not have to go through my three years worth of cells and manually select every ...