I keep getting a 1004 Error Application-Defined or Object-Defined Error when trying to copy and paste

I’m trying to copy Range A:3 to A:x (where x is the number of rows in the table “AgentName”) from sheet “AgentName” However, whenever I try to copy the range with a variable in it, it gives me the Error 1004. I’ve read through everything I could find. Here’s two common ones I’ve tried. Worksheets(“AgentName”).Range(“A3:A”&x).copy […]

All function in exportedUi works except for onload in Excel 2010

I have a .exportedUI file which like this. <cmd app=”Excel” dt=”0″/> <customui onLoad=”hellopig” xmlns=”http://schemas.microsoft.com/office/2009/07/customui”> <ribbon> <qat/> <tabs id=”test” label=”test”> <tab id=”tabtest” label=”tabtest”> <button id=”testbtn” label=”testbtn” onAction=”hellobtn”> </button> </tab> </tabs> </ribbon> </customui> And I have implemented the two subs which are hellopig and hellobtn. The hellobtn works well ,namely pop out a message box saying Hello […]

Identify Week Number, Month Number, Year from DatePicker control in VBA userform

I have been trying to make my user form work by getting codes everywhere. I don’t have any experience in VBA so the code that I have are patches from different sources. I have a datepicker control in my user form and i’d like to get the corresponding week number, month number and year based […]

Writing To A Range Using VBA array

I have a script that pulls the first cell value of a table from a database then adds it 10 times. now I am i want to populate that list to excel. any idea sub x() Dim myArray As Variant Dim i As Variant myArray = Sheets(“License Plate Number”).Range(“LP”) myVariable = (Trim(Right(mp_start, 12))) For i […]

Is there an If…Then loop for non existant HTML tag in VBA

I have a list of names I want to google birthdays for. This VBA script allows me to search and pull data from Google only if it has the specific element with that class name. Sub Searcher() Dim objIE As InternetExplorer Dim doc As HTMLDocument Dim y As Integer Dim x As Integer Dim result […]

combine two ranges (single cell and range) from multiple workbooks to worksheet

I got some script here to open up multiple workbooks with a worksheet and then copy it to a worksheet as a loop, but I need an additional cell (the date) from another worksheet in the multiple workbooks because the output I got cannot be changed and just added to the same sheet. What I […]

Send a second E-Mail automatically once the first E-Mail is sent (Excel-VBA-Code)

I have the following VBA Code to send an E-Mail: Sub First_Email() If ExitAll = False Then Dim OApp As Object, OMail As Object, signature As String Set OApp = CreateObject(“Outlook.Application”) Set OMail = OApp.CreateItem(0) With OMail .Display End With signature = OMail.HTMLbody With OMail .To = “test@test.de” .Subject = “First E-Mail” .HTMLbody = “<p> […]

MS Excel macro runs different from VB Script?

I have a VB Script file that I open using a task in Windows Task Scheduler each morning. The script opens MS Excel and then runs a macro stored in a workbook. The problem is that the macro runs differently if I use the VB Script file to kick off the macro versus when i […]

How to create a Heat Map in Excel out of a regular table

I have an Excel Table with following data (actually there are few thousand entries, see image for some example) The thing is that I would like to generate a Heat Map based on the price for a pair of OUTBOUND_DATE – INBOUND_DATE. Something similar to what airlines provide when we look for flight prices. They […]

SQL Server : stretch values to emptly cells

I have problem with my table which look like this: TABLE_XY Dog NULL NULL NULL NULL NULL NULL cat NULL NULL NULL Frog .. I need from my table dog dog dog dog dog dog cat cat cat cat cat frog frog … Do you know script which will stretch values to empty cells work […]

MS Excel Spreadsheet is the best Office Software, Excel VBA and Excel Formulas make Spreadsheet work faster.