vbcrlf

  1. J

    Creating mailmerge from excel using VBA

    Hi there, Please can someone help me? I have created (found on google) a code to create amailmerge from excel using a Macro. I am an absolute novice with VBA so pleasego slow! The code is: Dim Outlook As Object Dim Email As Object Dim ws As Worksheet Dim ws1 As Worksheet Dim address As...
  2. J

    Popup timer

    Hi, how can i make the codes below popup display reminder every 2 hour message. Sub popup()Dim lstRow As Long Dim i As Long Dim msg As String msg = "The following items are almost due" & vbCrLf & vbCrLf lstRow = Range("A" & Rows.Count).End(xlUp).Row For i = 2 To lstRow If Range("A" & i) -...
  3. B

    Microsoft Access cannot find the referenced form 'frmTagPrintEquip'

    I am running SQL statement but get the title error. The form is a lookup combo box that is closed until a cmd button opens it. strSQL = "SELECT tblTag.TagNumber, tblTag.TagID, tblEquipment.Equipment, tblEquipment.EquipID, tblTurnaround.TurnaroundID " & vbCrLf & _ "FROM...
  4. J

    Remove conditions

    Okay, I am having a total brain fart and should be able to figure this out.. This is part of the code for one function in my massive dBase. As you see it's a Yes, No, Cancel call. I want it to default to NO all the time and go right to the IF statement, without it popping up the Yes, No...
  5. P

    Stuck with Macro to Remove Duplicate Rows

    Greetings, I have a macro to remove duplicate rows that I'm pretty sure used to run, but it isn't working now. I haven't used it in quite a while, but yesterday I needed it and it crashes with a run-time error 1004 at the "ActiveSheet" line. Can anyone tell me what is wrong with it? Sub...
  6. A

    Making several cells mandatory before letting to same and close

    Hello Excel experts, I have been running around to find a solution for making several cells in different sheets mandatory to fill. The excel will be sent to third party to fill and send back, I would like to avoid email ping pong to ask for missing cells, below is the code I am using and it...
  7. K

    help with this code for assigning a value to a cell when another cell contains a specific string value

    Column P (16) contains 'codes' that represent a description of something. Example: "CSR2B" = wrong labels Also there can be more than 1 code in each cell in column P (and almost always will be more than 1 actually.) (which is whY I am using the 'Like' operator and the '& vbCrLf' ) For the...
  8. P

    adding data from combobox if checkbox is clicked on into email

    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...
  9. J

    Generating an Email with VBS ?

    Hi, i know VBS works almost exactly like VBA so this should be doable: i have the following which currently works: Dim outobj, mailobj Dim strFileText Dim objFileToRead Name1 = Inputbox("Enter Name") Code1 = Inputbox("Enter your Code") Set outobj =...
  10. S

    File System Object

    Good Morning, I'm working on an error handler and stumbled upon this wonderful section of code, available from https://bettersolutions.com/vba/error-handling/log-file.htm Anyway, I don't want to enable File System Object in my reference library so I tried modifying some script to this Dim...
  11. S

    Error handlnig

    I have this piece of error coding I've written. Userform18, when called upon, gives some info on how to further handle the error. Because I have hundreds of pieces of "error coding" (each one of them is idential but has a different ### assigned in the "with error codes [xxx]" piece, is it...
  12. S

    Userform Closing Excel

    Hello, I have a userform that has decided that it is going to close excel each time I use it. I'm not sure where I've gone wrong in my coding and was hoping someone could double check it for me. thanks! Private Sub CommandButton5_Click()'"next" page button On Error GoTo Helper...
  13. O

    Insert image in msg.body

    Hi all, I'm looking to insert an image from file source "D:\users\Owen\Desktop\Test\IMG_123.jpg" into my msg.body. Is there a way this can be done? Sub Send_email() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("email") Dim Outlook As Object Dim msg As Object Set...
  14. O

    If not working

    Hi all, I am having some difficulty with my if function in the below code. I have highlighted in red the part that doesn't seem to be working. The problem that i'm having is the highlighted piece of script should check the value in "E" for Status "Approved" and the body of my email should read...
  15. D

    Adding Sheet and row address to MsgBox

    Well this is probably an easy answer but all I have tried gives me an error. This is the part that works as intended but I cannot derive the sheet name where found and the row it was found on that sheet. ElseIf rng Is Nothing Then Set ra =...
  16. S

    creating a button and then adding the code

    I'd like a piece of code that can create a button that perfectly covers cell A1 and then runs the following piece of code for only that row, not every row as the code was originally designed. Thank you for your help. Also, and the important part, it has to check if there are contents in column I...
  17. A

    SQL to VBA

    Hello all, I've been reading (lurking) these boards for a while now - all help so far has been much appreciated however, I now need something that I couldn't already find! I have been given an SQL query and asked if I can pull this data into Excel rather than having to use SQL Dev and emailing...
  18. P

    Counting Cells based on Formatting

    Hi, I use this code below to count cells based on their colour, which was coloured via conditional formatting: Sub SumCountByConditionalFormat() Dim indRefColor As Long Dim cellCurrent As Range Dim cntRes As Long Dim sumRes Dim cntCells As Long Dim indCurCell As Long...
  19. N

    Array or Loop how to question

    Hi guys, I'm still learning and I'm not familiar with using loops which I think would be the solution for this issue. So I have some code here that I wrote but I'm sure there is a much better way to input this using a loop or array: If Range("B9").Value = "" Then GoTo Handler Else...
  20. Z

    MsgBox modification to include clicking the "X"

    I have a simple Yes/No message box that will exit the sub if the user clicks "no". I saw on another forum where someone mentioned that we can "add another condition to test the user's response for something else in addition to vbYes (perhaps to test for no response by clicking the X to close...

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