vbnewline

  1. J

    VBA change condition and send email using loop?

    Good afternoon, I have 2 separate bits of code that work for a specified row, but I don't want to have to write it 100 times. the first is this one: Sub worksheet_change(ByVal target As Range) Set target = Range("G3") If target.Value = Range("O1") Then Call sendtest2 End If Set target =...
  2. S

    VBA: Code execution has been interrupted

    Hi, Please see my code below. It works fine when running. Hope someone can help, I'm still a newbie with VBA. 1. Every time I close my workbook, I get the message: "Code execution has been interrupted". Why? 2. Can my code be written smarter/shorter? Private Sub Worksheet_Change(ByVal...
  3. H

    format value in code

    I have the following code below which I need amended to format the value extracted from B1 for eg as $ 415,250.75 ("$#,##0.00") the value is extracted using VBA but not formatted asrequired above strBody = strBody & "Those over 60 days amount to " & Sheets(4).Range("B1") & " vbNewLine &...
  4. S

    using .htmlbody instead of .body in my email excel sheet macro using OutMail

    In the code below I specify the body of the email using a series of cell references from my workbook. Can I use the same approach and use .HTMLbody instead of .Body. I want to be able to format the body of my message or make it appear more aesthetically pleasing for the recipient A line below...
  5. G

    Gmail Smtp mail

    Hi, Please find the VBA code i am using to send mail.Getting error .(Run time Error '-2147220975(80040211)' : The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available) Tried to disable two step verification and enable...
  6. P

    Exporting multiple ranges to a text file (RANGE OF OBJECT GLOBAL FAILED)

    Hi Board This below mentioned script was written to save cell values of a6.. a210 and a1501..a1600 to a text file in g:\ with name text1.txt . Excel returns me with a Run time error of 1004 ( Method Range of Object _Global Failed) For Each t In Range("A1501:A1600").Rows at this...
  7. H

    Macro to highlight File Name

    I have file names in Col A on sheet1 , email addresses in Col b next to the file name and a macro which enables the user to select a file and to attach to outlook and then email the file I would like the code amended so that when the file is selected and attached the following is done 1) The...
  8. F

    Lock worksheet until the "TODAYS DATE" cell is populted

    Hi! I'm looking for a way ensure that no other cell can be populated within a workbook until the "TODAY DATE" cell is populated, which is cell "AE2" on the worksheet. I'd like to insert the code above my existing VBA. Sub SendWorkBook() 'Created by 20181018 Dim mystr As String Dim OutlookApp...
  9. A

    VBA Help

    Hi Can someone spot what's wrong with the below? It's for saving a sheet as a PDF in a folder and then sending via outlook email. Sub RDB_Workbook_To_PDF_And_Create_Mail() Dim FileName As String 'Call the function with the correct arguments FileName =...
  10. Ironman

    Why are my 3 message boxes repeating twice?

    Hi My 'Daily Tracking' worksheet has the following code: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("EntRng")) Is Nothing Or Target.Count > 1 Then Exit Sub ' PROCEDURE 1 With Worksheets("Training Log") MsgBox "Lifetime Mileage: " &...
  11. F

    Have mail list use concatenated cell from a worksheet to populate generated email

    I've implemented the below VBA to use to send the form that it is for to a specifc emai address, but would like the VBA to populate the "SUBJECT LINE" of the email it generates with a concatenated cell from the workbook. The cell is identified as AM11. Is this even possible? Sub SendWorkBook()...
  12. G

    Mystery: Filled Excel sheet is blank when attached to an email

    Hi all, I'm hoping you can help me solve a mystery. I have a button on a form that sends the sheet as an email attachment once it has been completed. The problem is that the email when received is blank and what had been filled out is no longer there. The code appears below. Any clues? Thanks...
  13. dannyok90

    cross excel problems - any known resolutions?

    Hi All, I'm having some problems with a spreadsheet I have created at work. I've created the spreadsheet in Excel 2007 and tested the spreadsheet on my computer to ensure it works right. its got links to other spreadsheets on the network. When I send out an email for people to go into it...
  14. sharky12345

    For each cell List items question

    I want to try and produce a single list of items in a range where the cell in column A is not empty. So far I have the following; LastRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).RowFor Each Cell In Sheet2.Range("A12:A" & LastRow) If Cell.Value <> "" Then FaultyList = "Site: " & Cell.Value &...
  15. dannyok90

    Hide and unhide Ribbons VBA

    Hi All, I have some code that hides the majority of the excel interface on workbook_open to prevent users from making changes that they shouldn't be. It works well but at the moment, when the worksheet opens and hides the ribbons etc it hides any other workbooks ribbons that are open, i put some...
  16. G

    Converting an excel sheet to PDF and attaching it to an email

    I have created VBA code that checks to see if certain cells on a form have been filled out and then attaches the excel sheet to an email. What I need to do is send the attachment as a pdf instead. I'm at a loss for how I would change the code (see below). Any suggestions appreciated. Thanks...
  17. B

    Concatenate Msg Box Results

    My question is ... how would I concatenate the results of the following message box code ... MsgBox ActiveCell.Offset(0,1) & vbNewLine & ActiveCell.Offset(0,2) The coded above makes the message box longer when there is no text found in ActiveCell.Offset(0,2) I would like the box to be only as...
  18. B

    send email based on cell content, email address varies per submission

    I presently have the following coding: Sub Mail_emsg7() Dim iName As String Dim PRI As String Dim StaffType As String Set xOutApp = CreateObject("Outlook.Application") Set xOutMail = xOutApp.CreateItem(0) iName = Worksheets("Sheet1").Cells(10, "E").Value...
  19. Z

    VBA to export dat files from each row of a workbook

    Hi all, i need help writing a macro that copies specific data from each row of a workbook and puts it into a separate dat file for each row. So far i was able to write something up that only works for the first row(seconf beneath header). How can i modify this to export each row on a separate...
  20. V

    Email from workbook

    Hello all I am currently using a macro to email an active line from a workbook, all works ok except the Gross profit figure show in the email body as 15.6367342 How can I code tag or format the code to show only one decimal point please 15.6 GP = Range("I" & ActiveCell.Row) objmail.Body =...

We've detected that you are using an adblocker.

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.
Go back
Back
Top