Hi Please can you help on the code below, this is in my command button but the email body is all in red, please can you help?
Private Sub CommandButton3_Click()
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Set aOutlook =...
I have a workbook, which I want to create a macro button to populate headers on certain worksheets in the workbook.
I have a macro button created in another workbook which works perfect. I figured I could copy and paste the code of the macro into this new workbook and edit it as I see fit...
I wrote some VBA to that adds a .csv file as a power query in Excel. The file location can change. I have some code that allows you to pick where the files are located, but I can't figure how to use that input to tell it where to look.
Below is what I have for getting the file location...
Hi goodafternoon,
I have thecode below where I am trying to add another line after the Comments which iswith a checkbox. I want to add ‘ Job Type’ as a heading
and the ComboBox6 Data if the Checkbox1 isclicked, can you help please?
[HTML]
Private SubCommandButton2_Click()
If...
Hi Experts,
In one of the cells i have the below formula :
ActiveCell.Formula = _
"=""Hi," & Chr(10) & "" & Chr(10) & "Good Day!" & "Please confirm the PO# "" & A2"
What i need is, the last A2 in the formula is not constant i want to use somethig like A & i where "i" will vary.
So...
Hello, I am trying to scrape some stock data from yahoo finance with a dynamic URL, I am using if/elseif statements based on the exchange because I am pulling data from stocks listed on different exchanges so based on that the URL changes. I am using if/elseif commands to create the conditions...
Hi all,
I am using this code to open a workbook with a splash screen as follows. Unfortunately when I enter it and try to exit, I get an error which states:
"Compile error:
Ambiguous name detected: Workbook_BeforeClose"
What should i do to correct it?
Private Sub Workbook_Open()
MSG1 =...
Good afternoon,
I have this code from a recorded macro, that imports the specific file into the open worksheet. (highlighted path and file)
Sub importnewfile()
ActiveWorkbook.Queries.Add Name:="Derby_Station", _
Formula:= _
"let" & Chr(13) & "" & Chr(10) & " Source =...
Hello friends,
I spent a while searching and googling a solution with no resolution.
Tried creating an array, but my array skills are lack luster.
Basically, I'd like a suggestion of an easier/cleaner block of code to accomplish the same thing. This code functions properly but seems very...
Have the following code in a module:
AdSelect.LDAlts = "---A---" & Chr(10) & Cells(ActiveCell.Row, "F").Value & Chr(10) & Chr(10) & "---B---" & Chr(10) & Cells(ActiveCell.Row, "G").Value & Chr(10) & Chr(10) & "---C---" & Chr(10) & Cells(ActiveCell.Row, "H").Value
If I open the workbook and...
Hi,
I am facing #1004 Application-Defined Error issue when try to apply below formula with VBA. The actual formula is :
=IFERROR(
IF(INDEX('Source data'!$D$4:$ES$40003,MATCH($G5,'Source data'!$EF$4:$EF$40003,0),MATCH(H$3,'Source data'!$D$4:$ES$4,0))="N",
INDEX('Source...
I need some help I am not sure why how to get this code to run I have tried a few different things, but I just want to be able to easily change the file directory via DIM
Directory = "C:\DATA"
FileName = "PRNT" & i & ".DAT"
DirFile = Directory & FileName
ActiveWorkbook.Queries.Add Name:="PRNT"...
I have the following code
ShowDateBox:
IPrompt = "PLEASE ENTER DATE FOR THIS REPORT:" _
& Chr(13) & Chr(10) & Chr(13) & Chr(10) _
& "(Normally Accounting MONTH END date)"
IDeflt = Format(Range(InsImpDate).Value, "dd/mm/yy") ' Define buttons...
Sub isAnyWorkbookOpen()
Dim wb As Workbook
Dim wbs As Workbooks
Dim msg As String
Dim answer As String
Set wbs = Application.Workbooks
msg = "The following worksbooks must be closed before continuing." & Chr(10) & "Do you want to save and close these...
Sub isAnyWorkbookOpen()
Dim wb As Workbook
Dim wbs As Workbooks
Dim msg As String
Dim Result
msg = "The following workbook(s) must be closed before continuing:" & Chr(10) & "Do you want to close?" & Chr(10) & Chr(10)
Set wbs = Application.Workbooks...
Hi good morning all, Please can help with the code below, the section half way down where it says Comments: I want this to be in bold, I have tried <b> but this didn't work, please can you help me?
Private Sub CommandButton2_Click()
If TextBox9.Value = "" Then
MsgBox "Please enter...
Hi Team,
I have a macro that works fine that adds a comment to the cells but if there is one there already it will stop. What I was hoping to do was rather that delete the comment, could I append another comment to it rather than delete and lose the previous one? Code as below for the part...
Hi All !
I have a piece of code written from the macro recorder which serves its purpose but runs quite slow as the data set increases, my VBA skills are limited so I'm wondering if or how the code below could be written to make the process more efficient ?
Basically what it will do is copy a...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.