#vba

  1. M

    VBA function for check if file with name that contain some word exists

    Hello everyone, I'm trying to write VBA function to check if file with name that contains some string exists. Currently I have a code like that: Function FileExists(path As String) Dim fso_obj As Object Dim full_path As String Set fso_obj =...
  2. A

    Open file if not already open

    Hi, The below code first checks if the required file is open, if it is open then use that file; if not, then open file from the path provided in the cell and read/write with that file. After completing the task, It further checks if the file path & name provided in the below cell is same or...
  3. B

    Clear Row Data based on Date Range

    Hello Everyone, I am using Excel VBA to copy data from other sheets to the "Sales" sheet, which is working perfectly fine. now the thing is I have two-row sales and BOB for the sales columns, data is loading from 1st till the end of the month, which I need to remove from today till the end...
  4. A

    Delete row if multiple conditions are met

    I am trying to create a code which checks if the Dictionary value exits or not in the Column A. If it does then check the value for 24th Column of that particular row. If the value in the 24th Column is not 7 or 4 then delete the entire row. No error message is shown when I try to run the below...
  5. B

    Using Union to Build a Range and Hide Rows

    What I am trying to achieve here with a certain portion of this code is to identify all the rows that have data in them in which a condition is or isn't met and then build a range using union and then hiding rows. The reason that I am trying to use union is because with what I had before I was...
  6. O

    Copy from one worksheet to another with paste value

    Good morning all, I currently have the following code written below that is a macro that will transfer data from my Capture worksheet to my Log worksheet under the next empty cell row however, I cannot seem to find a way to insert a VBA so the data copied from my Capture worksheet and pasted...
  7. A

    Attachments Embedded in the email Body

    Below is the desired output: Start of the email text Part 1 Text Attachment1 & Attachment2 Part 2 Text Attachment1 & Attachment2 End of email text However, my code seems to add the attachment files only after the Part2 Text. Could anyone please help me with the code? Sub Prepare_Drafts()...
  8. H

    Add multiple attachments within Outlook Body

    I am working on a file wherein I have to add multiple attachments within the Outlook mail body using the RICH TEXT function. Below is the desired output: Start of the email text Part 1 Text FILE 1 & FILE2 Part 2 Text FILE 1 & FILE2 End of email text However, my code seems to add the...
  9. O

    VBA Code Timestamp & Username Copy & Paste Method

    Good day all, I have the following VBA code below to help show when a change was made in one of the columns in my Excel spreadsheet as well as the username however, I am finding difficulties when I am testing my VBA code. I can only retrieve the username/time stamp if I double click on each...
  10. E

    Checking if cells are empty on "Change" event in Excel vba

    I have a macro enabled excel sheet - Sheet_Change.xlsm My goal is to check if a columns A and C only - are empty or not within a table. If cells are empty, then a message should appear and user shouldn't be able to enter a new record (row). It is currently works on any "Change" event. But I...
  11. Z

    Search for a value in a column, then modify all the cells contain this value by adding a number to the end

    I am fairly new to VBA. I need to create a macro that searches the entire column K for keywords " C Box", for any cell in this column that contains these keywords, I need to add a numerical value to the end of the text (this numerical is always in the same row as the cell that contains the...
  12. C

    Select Case using AND

    Hi Guys, Not sure why I can't use the and in my Case. I get a run-time error 13. Any help is greatly appreciated. Thanks ConfigType = LCase(Config_Cells.Offset(0, Partner - 5)) ConfigValues = Config_Cells.Offset(0, Partner - 4) Select Case...
  13. H

    SaveAs Range in Outlook Template

    I am getting an error when I run the below code. Not sure what is creating the issue. Can anyone help me with the code? Sub Mail_Selection_Range_Outlook_Body() Dim rng As Range Dim OutApp As Object Dim OutMail As Object Set rng = Nothing ' Only send the visible cells in the selection. Set...
  14. G

    Call double click automatically in a form

    Hi everyone, Hope you good guys. Since 1 week, I try everything in my possible and nothing works... The goal ? => I have a form that lists differents values in my cells. In this list, I have a search bar and I have to double click on a item to have what I want after. When I double click, another...
  15. L

    Find, select & delete all cells with specific value.

    Hi everyone, I've search through the available articles and can't find exactly what I'm looking for. I've also tried to record a macro and edit the output but nothing is working. I'm trying to write a macro that has multiple functions. The issue I'm facing is that my data set is basically an...
  16. M

    Count value when the value is a merged cell

    Hello, I'm a newbie to type VBA code. Recently, I would like to create a series of VBA code in order to accelerate work. Now, I have faced the problems below: 1. I would like to count the number of "LTG" which has 3 merged rows only.(shown in the uploaded image) 2. About the Find Function, I...
  17. N

    How to get the latest emails and append to the existing file instead of looping through all items using VBA?

    I have a code that loops through all the outlook emails under a subfolder and extract the body of the email based on the subject. How do I modify the code to only append the data extracted from emails in the existing file instead of looping through all the emails and overwriting again & again...
  18. N

    Invalid Next control variable in macro

    Hi. I keep getting an error as Invalid Next control variable reference for my below code. Any help would be greatly appreciated. Option Explicit Sub ImportTable() Cells.Clear Dim OLApp As Outlook.Application Set OLApp = New Outlook.Application Dim ONS As Outlook.Namespace Set ONS =...
  19. N

    VBA to extract data from outlook mails

    I have a VBA code that extracts table data from outlook emails but from a particular subfolder. I want to generalize my code and instead of searching in a particular subfolder under "Inbox", I want the code to filter the emails directly from the "Inbox" folder and then extract the tables from...
  20. albytross

    find partial matches in header of all worksheets and replace with set values

    Hi, My background is CSS and HTML (yes, i'm a fossil). Can anyone help with some code? I'm impressed how much i've managed to get done using various forums but now I am well and trully stuck. I have a workbook open with numerous worksheets (the total number of worksheets changes, depending on...

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