Questions tagged [excel-vba]

26465 questions
1

votes
0

answer
178

Views

Add Comments to Excel pivot slicer options

I have been trying out searching multiple forums before posting this question here. Issue: In one Excel pivot table slicer I have almost 50 options. I have given codes to each slicer option rather than writing entire description about the slicer option. I am looking for some VBA help where in I can...
excelislife
1

votes
0

answer
31

Views

How to fetch data in R by executing command in excel?

I have to fetch data from Reuters and they provide an excel plugin for that. The problem is that my excel is crashing if I try to fetch too many variables at the same time. I was wondering whether I can do it from R via some excel connection. In general I want to give the command to excel (from R),...
Nikhil Vidhani
1

votes
1

answer
45

Views

How to skip specific columns in a Row copy

So, I'm looking for a way to skip specific columns in a row copy. I'm working with doing a bunch of loops to copy/paste from a bunch of sheets of variable sized reports and I want a way to simply skip a column or columns in a row copy since I can't just do a entirecolumn.delete to deal with the exce...
George
1

votes
2

answer
53

Views

Excel VBA to Remove Opt-Outs

I am a military recruiter and am trying to use autofilter to filter out a range from another range. I got this from another stackoverflow page but can not figure out how to change that string strSearch to a range like [email protected], [email protected], [email protected], etc. We get lists of leads but I'd like to keep t...
Joe
1

votes
0

answer
38

Views

I am using a cell value in Excel to look up an array based on that cell value

I am using =VLOOKUP(C$2;INDIRECT(C$2);6;FALSE) One of the inputs (a serial number) is MK05391. When I create the range for this row and name it the same as the serial number it won't let me. Says that The name either does not start with letter/underscore, or there's something else namned the same th...
Vrig
1

votes
1

answer
74

Views

How to get dynamic node and element values in xml using vb?

I am very new to vb. In my XML file all the attributes, nodes and elements are dynamic(Healthcare.xml). I am trying to get the values in the below manner. page: login, method: login, args: ad59090,GA124444 In some cases, there will be multiple methods and arguments. page: benefits, method: tagbenef...
Nandan A
1

votes
0

answer
326

Views

Trouble with sending a left click

I have a series of clicks and cursor movements I have in a macro. Everything works fine until the end. All the clicks work until the last click. I have tried to put various amounts of sleeps in between the clicks and before the clicks. Whats odd is that when i click for real it works! ahh Whats also...
Justin Captain Wypij
1

votes
1

answer
210

Views

VBA Run-Time Error 1004 on ActiveCell.FormulaR1C1

The formula in Excel cells '=DATEVALUE(IF(ISERROR(INT(LEFT(MID(D2,FIND('/',D2)+1,LEN(D2)),FIND('/',MID(D2,FIND('/',D2)+1,LEN(D2)))-1))),DAY(D2),INT(LEFT(MID(D2,FIND('/',D2)+1,LEN(D2)),FIND('/',MID(D2,FIND('/',D2)+1,LEN(D2)))-1)))&'/'&IF(MID(D2,LEN(D2)-4,1)='/',INT(LEFT(D2,FIND('/',D2)-1)),MONTH(D2))...
Eric
1

votes
3

answer
541

Views

Excel VBA ByVal Target As Range Does not update Target Worksheet when excuting from a function cell

I'm having a issues with copying a value from a cell that is using a function to get its value from another cell. Insert value into A1, A3=A1 and when ever the value of A3 changes the changes need to transfer automatically to column H. The issues i having is that if i type the value into A1 then A3...
Kenneth O'Donnell
1

votes
2

answer
278

Views

Excel VBA Changing Combobox list from static range to dynamic

This should be pretty simple, but I am struggling. Right now, this code works: cboCategoryEdit1.List = Sheets(2).Range('A2:A40').Value I am trying to 'clean up' my project by changing how the combobox is populated. I'd like it to be a combobox with a range that only takes populated cells. Meaning...
jpend314
1

votes
2

answer
1.8k

Views

Run Macro without opening Excel

This is my first time using VBs. I used to it to automate Excel macro but I failed due to the spacing between filenames. It works fine if the space was removed. I read this post and used the double quote method but did not work. This is how I used it objExcel.Application.Run '''C:\Users\account\Desk...
Max
1

votes
0

answer
414

Views

Highlight Cell in one Column BASED on Conditional Formatting of Other Columns

I am a beginner with Macros. I slightly changed my code below to include conditional formatting based on an Input Value. The code below applies a conditional format (orange highlight) to 6 specific columns based on whether those columns contain a specific text. I would like to add another step afte...
NoeyPI
1

votes
2

answer
238

Views

How to add dynamic comment to column with validation list?

Given an excel column with a validation list (dropdown). How do I show a dynamic comment based on the selected option? Thanks
fabian
1

votes
0

answer
93

Views

Copy Range of cells to Visio (2013) using VBA code

I have an Excel range of cells (let's call it 'Table A') and I would like to copy that Range/Table into Visio using VBA. Without VBA - I can copy the range in Excel, go to Visio - Insert - Chart - go to Sheet1 tab - Paste Using VBA - I am a novice so this is what I think it should look something li...
Shadowcast
1

votes
0

answer
54

Views

Combining vba filters

Does anyone know how to combine these two lines so that when I run the code rows that contain Oranges do not appear. At the moment, only the first filter is working. So I get all of the Apples, but the second filter does not. Thanks in advance! ActiveSheet.Range('B4', Range('BT4').End(xlDown)).Auto...
Gandalfrandalf
1

votes
0

answer
44

Views

How can I compare and change cells in Excel

I have two sheets. In both sheets I have a column (B) where each row is a different name: Sheet 'A' has names in the column, these names are 'leading'. Sheet 'B' also has names in this column, these names CAN BE outdated. What I want: A macro which can check the names. delete the names in Sheet B...
Adventador
1

votes
0

answer
531

Views

Excel slicer multi-select functionality turns off when workbook is closed?

I have a workbook that contains a report with tables and slicers. Currently, when the user opens the workbook, they must manually click the 'multi-select' option on the slicer. Is there a way to keep this permanently selected (even when the workbook is closed and re-opened)? Thanks!
Arjun Arun
1

votes
0

answer
285

Views

Excel VBA - Pictures do not display when I add Private Sub macro

I have images pasted (not linked) into my excel workbook. When I try to add any Private Sub macro code, the next time I open my workbook, the images come up with the message 'This image can not be displayed'. However, images on other sheets display correctly, and if I save the workbook on a differen...
mcflame
1

votes
0

answer
293

Views

Excel VBA Find Date - Run Time Error

I have a problem with my VBA code and I hope someone can help me. What I'm trying to do here is the following: I have a worksheet (Sheet 1) with data that gets updated every day. In order to preserve this data, I want to copy and store the source data on another worksheet (Sheet 2). Sheet 2 has colu...
Willemien
1

votes
0

answer
148

Views

Error Message Occurs in Saving Excel Files when I use Excel VBA Function

When I try to save the below code it gives an error message and I can't save it. below are my error message's image file link. I'm using Korean Excel 2007, So I don't know what exactly this message is in English but I can give you the meaning of this error message. (this error message means... could...
박영종
1

votes
0

answer
28

Views

Maintain source formatting with column reorder Excel VBA

I have been importing data from a downloaded report into a working-copy excel workbook for some time now, but someone higher up than me recently decided to change the report that I download for my information. The easiest solution seems to be to re-order the information in the report workbook befor...
Jon
1

votes
1

answer
246

Views

Excel VBA loop through cells to find Conditional Formatted cells and copy paste on other sheet

My issue: I want to loop through a range, and whenever it finds a conditional formatted cell, it should copy the cell to the left to the cell to the right of it. And then afterwards paste it into an other worksheet. My code loops through the cells easily, but doesn't copy the information, and paste...
Patrick S
1

votes
0

answer
149

Views

How to extend or merge interfaces in VBA

I am creating a custom collection class in VBA, whose members must implement two interfaces. One is a library interface IComparable which allows me to sort my collection, the other is a home-made interface ImyObject which guarantees certain properties of the members of the class. I ensure only the c...
Greedo
1

votes
2

answer
58

Views

I'm trying to extract data in the tag <a data-params> from Amazon.com website

I have set of Amazon URLS (https://www.amazon.com/dp/B01LTIORC8) in column A in excel and Im trying to extract 'B00M4L4MFC' data from ' href='/dp/B00M4L4MFC/ref=dp_cerb_1'' in column B using the below html tag. I found the below code online : Sub GetAboutUsLinks() Dim internet As Object Dim html As...
Sri Ram
1

votes
0

answer
73

Views

vba countif for duplicates when validating another data

I'm trying to copy data into new workbook and validate the data by removing duplicates keeping one cell value as the source. All I wanted is the count of XD in the worksheet provided there are no duplicate Record locator. Also I wanted the count to be in a msgbox. Can someone help ? Sub openworkbook...
Kathir1k
1

votes
0

answer
73

Views

DblClick Cell text cursor blinking

I have cell with value of string type. I programmed a Public Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) procedure to show UserForm after doubleclick on some cell - let it is 'B3' cell. The UserForms is showed after doubleclick but there is blinking text cursor somewher...
Juraj
1

votes
1

answer
822

Views

Get the address of the changed cell

I'm trying to trigger a macro (dependant on cell address) whenever any dde linked cell value is changed. I tried Workbook.SetLinkOnData and Worksheet_Calculate event (with a dummy formula to trigger the event), but the problem is that none of them returns the address of the updated cell. So is there...
user3286479
1

votes
0

answer
68

Views

How to skip particular text cell in Excel VBA

When I run below code how can I skip particular text cell from merging. Original data S.No. Clock No. 01 02 03 04 05 06 1 099566 W P p P P P 2 282420 P P P W P P 3 623738 P P W L P P 4 406290 P P...
1

votes
0

answer
493

Views

Run same macro on different worksheets

I have a workbook with 10 worksheets. I recorded a macro for creating a pivot tables from the first worksheet. When I run the macro in another worksheet it just created the same pivot table containing data from the first worksheet even I had replaced the worksheet name with ActiveSheet in the scrip...
Arayau
1

votes
0

answer
243

Views

Variant type mismatch at run time

I am trying to automate Bentley Microstation from Excel using runtime objects without project References for a proof of concept. Sub MSFromXlRuntime() Dim MS As Object Dim DesignFile As Object Dim Line As Object Dim startPoint As Variant Dim endPoint As Variant Set MS = CreateObject('MicroStationDGN...
Alex
1

votes
0

answer
39

Views

Opening a tiff file from Excel causing loss of Cell Edit functionality

I have a spreadsheet, with different people using copies on different PC's. There is a macro triggered by Worksheet_Selection_Change that opens an image file. On two of the PC's, when the workbook is opened, the user can't edit a cell without double clicking in it. Also, the Selection_Change even...
1

votes
1

answer
87

Views

VBA email reply - text does not add

I'm writting macro that finds an e-mail and replies to it. The problem is that the text I want to reply with does not add. Could you please tell me what I'm doing wrong? Sub Test() Dim olApp As Object Dim olNs As Object Dim Fldr As Object Dim i As Long Set olApp = CreateObject('Outlook.Application')...
Tomek
1

votes
0

answer
385

Views

Excel VBA ADO Recordset - Issue with SELECT columns

I get Runtime error '-2147467259 (80004005)': Unspecified Error when I use the following code: Set conn1 = CreateObject('ADODB.Connection') conn1.Open strcon1 strquery3 = 'SELECT * FROM TABLE_NAME' Set rs3 = CreateObject('ADODB.Recordset') Set rs3 = conn1.Execute(strquery3) However the code works w...
Rajat Solanki
1

votes
0

answer
83

Views

Close Internet Explorer msg box. FindWindowEX function? childHWND?

I'm looking for the solution to close IE browser message box, using Internet Automation in VBA. See attached photo of the screen. I am not considering keypress event as a good way to do it. However I found piece of the code which 'smells good' for a solution of this problem. https://social.techne...
Jacek Rzadca
1

votes
0

answer
37

Views

VBA Excel Script Save as TXT CSV, UFT-8, set specific field and txt delimeter and Quote all TXT cells

I have been trying for a few days to crack this. We have a Lotus Notes DB that will only accept and import of a file only if it is saved in this method 1) Opening a XLS in Open Office 2) Selecting all cells (always a single worksheet) and setting Default Formatting 3) Saving as TXT CSV 4) Then as p...
Kal-el
1

votes
1

answer
170

Views

VBA Runtime error 91 when already used SET?

I'm getting Runtime Error '91': Object variable or with block variable not set when I already used the set keyword. I read this old post that says set is used to assign a reference to an object. What does it really meaning? Also read about POST A & POST B but no much help. Dim strPath2 As String Di...
Max
1

votes
1

answer
575

Views

Excel Conditional Formatting and Rounding Issues

I am trying to find a way to use excel formatting to show the color red when a specific cell is not equal to another cell. However, there are times when the value is off by two or three numbers due to how excel rounds(ex: 593=594, 593=592).Is there a way to use excel formatting or any other way to m...
mikerosd
1

votes
1

answer
138

Views

Merge Data From multiple tabs to one master tab

I try to merge the data from multiple tabs to one master tab. Since the concepts in those tabs constantly updated every day (always adding the new information), I want to make sure my master tab is always up to date, and include all updated concepts. Below is the coding I came up with in VBA. Howev...
Lucy
1

votes
2

answer
70

Views

Record moves to a wrong row on another Excel sheet

I have a macro that moves row from one sheet to another one once I time the word 'Completed' in a certain field. The problem is that it moves row into a wrong place. I have 212 rows on another worksheet, the next row should be moved row #213 on another sheet, but it moves all the way to the row #65...
icittar
1

votes
0

answer
140

Views

VBA - WinHTTP Authentication on redmine failed

i am looking into this issue since days but i am not able to find a solution. I want to use WinHttp Authentication via VBA to Login to our Redmine to get the current issues.csv file for my Excel spreadsheets. I already found this useful question on Stackoverflow and adapted the Code(Not understandin...
ChristianR

View additional questions