Questions tagged [excel-vba]

THIS TAG IS PENDING REMOVAL. Instead, please use tags [excel] and [vba]. (More info: https://meta.stackoverflow.com/q/370095) Excel-VBA (Visual Basic for Applications for Microsoft Excel) is the dominant programming language for Microsoft Office Excel. It is an event-driven and object-oriented programming language for writing macros for Microsoft Office applications like Excel. DO NOT USE THIS TAG for VB.NET questions.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Problems with Excel VBA, ADO on Excel Table

I'm currently trying to extract records from an Excel sheet using VBA and ADO. Whereas the Excel Sheet is in Excel Table Format since the rows are expanding daily. Problems I'm having are : The ...
0
votes
1answer
22 views

Vlookup in vba to find values between two worksheets

I'm trying to grab the values from a different worksheet and match them to the their sister data in my main sheet in column A but I'm having issues with getting the right results, I was thinking of ...
0
votes
0answers
11 views

Counting Font color in Excel

I am trying to count the number of cells that have a blue font and It won't work. I can count cells with a red font but not blue. This is a custom function I have created using VBA Function ...
0
votes
0answers
15 views

Loop through columns, filter out 0's and copy data to separate tab

What I am trying to achieve is for my macro to filter column C by removing all the 0's and then copy and pasting column C to a second tab called 'New'. I then need the macro to return to the 'Main ...
0
votes
0answers
20 views

Insert formula if neighbor cell has value

I want to insert a formula in my table if the cell to the right has a value. My code: Sub whbweh() For Each cel In ActiveSheet.ListObjects(1).ListColumns("x").DataBodyRange If cel....
0
votes
0answers
22 views

How to move multiple cells in multiple sheets (to the top of the list)

So what I want is to make a prioritize button that will put a row of data to the top. The trick is there are multiple sheets where the same row needs to be moved up to the top and not all of the ...
1
vote
2answers
38 views

How to find the nth non-blank row of a column?

OK... Long story short I found a bug in my code where I thought I could simply find the last row in column "A" (which is row 213). However, I actually needed row 219. This gap may be inconsistent, ...
0
votes
0answers
16 views

Finding a word in a cell and check if full word is longer, then make it bold

I'm creating a dictionary format in Excel. There are words which I need to find in the corresponding sentences and make them bold. However, the issue is when I find them, a word may be longer in the ...
0
votes
0answers
31 views

Excel VBA automatic function reset / image load

I'm using function OnMouseOver to load specific picture based on text in cell. Dim DoOnce As Boolean Public Function OnMouseOver(URL As String, TheCell As Range) Reset If Not DoOnce Then DoOnce = ...
3
votes
3answers
104 views

Copy ONLY text from one range and paste ONLY the first three text on another sheet

I have up to 6 cells with potential data coming from 6 different places. I am trying to get only the first three cells with data transferred to another sheet Private Sub Transfer_Data() Sheets("...
1
vote
2answers
70 views

Moving to next empty row to fill cell from Userform

I am currently creating a system using VBA for students to choose their classes in university. I have created a userform 'AMForm' for students to do this, where there are adjacent option buttons for ...
0
votes
6answers
83 views

Is there code I can use to hide all rows except for the row containing the value I am searching?

I have a search box that auto opens when the file is started requesting the target value. I have tried many times to write something that will hide all rows above and below the value once found, with ...
-1
votes
1answer
66 views

Excel: Adding new row to bottom of table, when there are two tables (vertically) in the same worksheet

I have a problem which is probably very easy for you to help me solve. I have two tables: Table1 and Table2. Both tables are in the same worksheet called "Budget". I want to add a command button / ...
0
votes
1answer
117 views

Run Time Error 13 Type Mismatch on combo box with alphanumeric data

I'm trying to setup an update data entry form. How can I transition from integer combo box with only numerical values to a data type using string or long combo box with alphanumeric values? Private ...
0
votes
1answer
59 views

My VB script runs as long as I don't switch windows by clicking “Alt + Tab”. Why?

The script works perfectly. Except if I don't press "Alt + Tab" 2-3 times it will take at least another 30 minutes to finish. But If I switch using "Alt + Tab" it finishes in less than 2 minutes. My ...
1
vote
1answer
1k views

speed up excel vba copying data from one sheet to another

on one sheet I have rows of data from column A to column L. I have a macro that, given user input, searches the rows, and then copy and pastes that row into a different (initally blank) sheet. The ...
0
votes
0answers
28 views

Run EXE from RDP Window (RDP Window is linked to Weblink)

A Weblink login has list of IPs connecting to remote desktop I am able to click particular ip using “ie.document” But that links open another window of Remote Desktop (Which is Server) of that IP ...
0
votes
1answer
43 views

Excel VBA : Creating the variable with Cells name and Assigning their values to them?

Need help in creating an array in excel than can take values of cells only for a column. Example
0
votes
2answers
31 views

Set font.color if month value is the same

Hi i can't make this block of code to work Dim rng As Range, cll As Range Set rng = Range("January") ' I defined custom range with name January For Each cll in rng If Month(cll) = Month(A7) ...
0
votes
2answers
167 views

If loop using multiple checkbox values as If condition

In the below code i am trying to set a check box value as true only when three other check boxes are true. when I use a simple IF statement for checking the execution skips the code even though all ...
0
votes
4answers
108 views

How to transpose these row values into this specific format using VBA?

I am using Excel 2016 and I am new to VBA. I have an Excel worksheet which contains 262 rows (with no headers). An extract of the first 2 rows are shown below (starts at column A and ends at column L):...
0
votes
3answers
104 views

Excel 2016 VBA - Delete multiple rows if value is found in string

I'm trying to delete multiple rows, if a particular word ("Bottom") is found in a cell. My data in column A looks like this: OMC Hold Value Bottom 13% Advertising and Marketing WPP Sell Momentum | B ...
0
votes
2answers
66 views

names that have 10 highest values for each column with vba

I want to get names that have the 10 highest values in each column by using only VBA. The list of column names is specified in an argument, and the number of columns and rows are not fixed, so I need ...
-2
votes
1answer
218 views

Special IF/THEN Statement And Data Validation List In VBA

The best way I can explain what I needs is this: if A1 = "" and A3 = "", then put a data validation list in cell A2. If A1 = "" and A3 <> "", A2 = A3. If A1 <> "" and A3 = "", then A2 = A1 ...
-1
votes
3answers
51 views

How to create a loop and move to the cell below when a condition is not met on excel or VBA?

I have a list of keywords and a list of questions on excel. I need to see IF every single keywords is found into the questions or not. e.g. A B 1 expense how is my ...
0
votes
0answers
33 views

Why a macro is not called by SetLinkOnData?

HI everyone I try to detect the change in a value provided by a link dde, can you help please ! note : I have the dde link in cell A1 so the values changed automatically in A1 Sub UpDateDDE() Dim ...
0
votes
1answer
37 views

Having problems permutating an matrix in vba (Excel)

I believe the problem is in the second for because of the differences between c# and vba but I'm not 100% sure so any and all help would be appreciated. Literally everything kraj = False j =...
1
vote
2answers
165 views

Is there a reason why VBA code does not work in sequential order?

I am not entirely sure how to phrase this question. However, I will be able to explain it better here. Below is my code. The purpose of my code is to copy and paste data from one sheet to another. ...
1
vote
1answer
64 views

Extract English letters and numbers using regex

I have the following code that extracts the English letters from mixed English and Arabic letters Sub Test() Dim a As Variant Dim i As Long With Cells(1).CurrentRegion.Resize(, 3)...
0
votes
1answer
42 views

How can I dynamically decide the number of worksheets and perform calculations on them?

Is there any way with VBA to decide the number of worksheets in a workbook and perform calculations on a predefined range of cells in those worksheets. The worksheets in the workbook may change as new ...
1
vote
1answer
52 views

How to copy values based on multiple cell criteria to another Sheet

I have an input range (F9:F58) in sheet "Form", and I need to copy those input values to table in another sheet "Databased" based on multiple criteria (E2) & (E6) in sheet "Form". Note: the ...
0
votes
2answers
35 views

VBA opening a few worksheets and copying cell value to the current

I'm trying to open a few workbooks in a folder to pull some data to the ThisWorkbook. For now I'm having a few problems with Cells notation. Option Explicit Sub UpdateAttendance() GetData End ...
1
vote
3answers
39 views

unintended autonomous changing a1 / r1c1 notation in vba excel 2010

i have an excel/vba issue which seems to occur in excel2010 but not excel2016. for me it is a non comprehensible conversion between a1 and r1c1 notation. i have a range that is dynamic Dim rng As ...
-1
votes
1answer
249 views

Excel vba list box multi column multi row from 14 text boxes

I have user form with 14 text boxes , 2 command buttons " next " , " Post " and 1 list box I need code to get the data from the 14 text boxes to the list box , again when the user enter new data and ...
0
votes
1answer
36 views

How to implement a formula at the end of your loop in vba?

I'm trying to essentially have a loop that counts certain criteria for me. At the end of my code I want to make it so that whatever is not counted is essentially called "DRSNR". I know I could use a ...
0
votes
1answer
304 views

How to consolidate data from multiple columns into a single column group

I have a sheet that collects data from weekly time sheets workbooks. There is a single cell in each workbook that pulls all the data I need transferred into one cell. The data is from a range of 29 ...
1
vote
1answer
33 views

Cannot navigate from an already loaded webpage to another with vba

I have the following in order to get data from webpage and I arrange them per column in a worksheet. I take one of the data which is a URL and after I put them in cells I want to navigate again to ...
0
votes
1answer
228 views

How to extract all drop down values from a data validated cell in excel to single cells for each value?

I have a drop down list in Excel with 500 values in it. How do I get those values into single cells for each value? Basically, 500 values in 500 different cells from where I can use those values ...
3
votes
1answer
80 views

Kick user out of a cell during “DoEvents”

I there a way of using VBA to hit enter or down or select another cell, while a user is editing a cell? I am creating a quiz for children and want to ensure that the child doesn't press enter after ...
2
votes
5answers
130 views

Excel VBA RegEx that extracts numbers from price values in range (has commas, $ and -)

I have a field data extracted from a database which represents a range of values, but it's coming in Excel as a String format $86,000 - $162,000. I need to extract the minimum value and the maximum ...
0
votes
1answer
41 views

Cannot exclude tags which are inside a <li> tag with vba

I have several pages like the following https://www.skroutz.gr/s/2195774/Western-Digital-Blue-3-5-1TB-7200rpm.html I want to extract with vba data like price,availability,seller name When I try the ...
0
votes
3answers
73 views

VBA HTML Listing Info Pull

I am looking to follow a series of URL's that are found in column A (example: https://www.ebay.com/itm/Apple-iPhone-7-GSM-Unlocked-Verizon-AT-T-TMobile-Sprint-32GB-128GB-256GB/352381131997?epid=...
1
vote
1answer
78 views

Button in same cell on each sheet

I need to put a button in the top left corner (A1) of each sheet that returns to the home sheet. I can't get it to add on all the sheets - it stops after the first sheet. The below is what I've come ...
1
vote
0answers
87 views

How can I combine the multiple strings in to one cell by using a reference cell in VBA?

Workbook link: https://ufile.io/gm0fn I have a VBA macro code that returns search results given a search criteria by using the AutoFilter syntax. The purpose of this code is to search literature ...
2
votes
2answers
48 views

How do I fill a series using VBA?

I'm trying to get my code to search column D for cells that are not blank. When it finds one that isn't blank it copies that cell and fills the series beneath. Then I want it to repeat this code until ...
0
votes
0answers
38 views

Storing weekdays within a given date range in a scripting dictionary using Excel VBA

I provide two input params. startd and endd. These are dates in format mm/dd/yyyy. I want to store the weekdays between this date range (start and end inclusive) into a dictionary. I have the below ...
0
votes
1answer
68 views

How do I return results to several cells?

Excel sheet to be filled with three results: I have the following code (simplified to explain my problem): Public Function addieren(X, Y, Z, value) As Double ' function to calculate three results ' ...
0
votes
2answers
52 views

changing sizes of individual userform pages

I have an excel multipage userform, and I would like the pages to be different sizes/height. I have tried the following code: sub multipage1_change() select case me.multipage1.value case 0 Me....
0
votes
1answer
22 views

Conditionally setting the Scripting Dictionary values in Excel VBA

I have a Master.xlsx. I have a two variables startd and endd - that defines date range I should be storing in my dictionary. I also have the list of holidays in a separate worksheet which I am trying ...
0
votes
1answer
58 views

How to write VBA function activating different sheets?

I'm writing a VBA function using an input that determines the sheet containing other inputs. With different curvename, the function should refer to data in different sheets. My code is as below: ...