macro

  1. J

    Delete a particular string defined in Range of Columns across sheets

    Hi , I have managed to write this VBA code, where in to delete the string named "Do Nothing", across all the sheets in the workbook. code without looping each sheet it's working. However, After Inclusion to loop across the worksheets, it's failing to loop through all the sheets, instead only...
  2. B

    VBA to copy cell value to another column with dynamic rows

    Hello people, I'm running to an issue here with a table. I need to build another column, lets say "Column 13", and for each row I need to fill a cell with the value from Column 1 as shown below. ABCDEFGHIJKL1Column 1Column 2Column 3Column 4Column 5Column 6Column 7Column 8Column 9Column...
  3. K

    VBS macro doesn´t run

    I'm trying to close the CMD after running my vbs file, can someone help me? Code: Dim objExcel, ObjWB WScript.Sleep (200) Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set ObjWB =...
  4. M

    Subtotal by Funding on one sheet but put the results on another sheet

    What I'm trying to do is create a macro that does the following: 1. On the "By Transaction" worksheet sort by the Funding column . 2. Subtotal by Total Amount Due by a change of Funding 3. Copy the Funding and Total Amount Due Subtotal onto another sheet "By Funding" where there are other fields...
  5. P

    How to keep only the top row of a value and delete the rest of the rows

    Hello, I am new to VBA and would like to get assistance from the experts if possible. I have a number of duplicated booking numbers with different data captured in subsequent columns. In order to identify the duplicated bookings, I have numbered them in column FL (FYI, the number of...
  6. K

    Creating a procedure to search in a column

    I have 3 columns A - Equivalent to "Machine Name" B - Equivalent to "OT Number" C - Equivalent to "Responsible Technician" I would like to know if it is possible to create a procedure that when the user inserts the "OT Number" the procedure looks in column B if there is already an "OT...
  7. K

    Object Required Error

    I have a form called "Miter_2_Correc", and I don't know why vba won't let me open it, can someone help me? Code: Private Sub bt_calculate_Click() Call CheckEmpty End Sub Private Sub CheckEmpty() If Not IsNumeric(tb_x1.Value) Or tb_x1.Text = "" Or Trim(tb_x1.Text) = "" Then...
  8. K

    VBS Script error

    I created an excel file that runs a macro as soon as it starts, when I open the file normally the macro is successfully executed but when I open my ".vbs" file an error occurs, can someone help me? Dim myMostRecentFile As String, ola As String Dim Ws As Integer Private Sub WriteValues()...
  9. J

    Need to remove leading spaces within cell while retaining the Numbered Bullet Points

    Hi, This is my first thread. I have following the steps to reproduce, my excel sheet column contains a lot of rows like below like 100 to 300's. But the problem is there few white spaces as leading characters which I don't want. I have tried using TRIM() and CLEAN() functions it trims...
  10. K

    Automatic executable creation

    Is it possible to create a vbs file similar to the same one but that is automatically executed when a new file is inserted in the folder?
  11. K

    The program does not detect a specific folder

    I am trying to open the most recent file in a specific folder but when I run the program an error appears and says that the folder does not exist (but it does exist), can someone help me? Code: Private Sub WriteValues() Workbooks.Open (myMostRecentFile)...
  12. E

    Macro to cycle through drop-down selection (with conditional) to print to PDF (name in cell) and save in X path (path in cell)

    Goodnight everyone, First I would like to tell you what I have been doing so far and then request your help. I have this excel file which is mainly made up of two sheets: 1. Apartment information sheet 2. Sheet to make quotes for the apartments In the quotation sheet, I have a cell where I...
  13. N

    Macro to group data

    Hello, I have a list of product codes, descriptions and locations. I require a macro based on the highlighted list to create 4 columns with headers please. Product Code, Decription, Loc, Count, then the data, then a space and then the header again, with data etc etc. The data is grouped by...
  14. K

    Procedure doen´t result

    Hello guys, i have a problem in my procedure, everything that happens before trying to execute the procedure is read by the program, but when we call the procedure it doesn't just work in the specific form, can someone help me? This codes works: Private Sub bt_calculate_Click()...
  15. V

    Macro to copy range including hyperlinks but not formulas

    Hi! I am trying to copy a range (A1:A7) from one sheet to another. All cells in range have formulas and one cell in particular (A1) has a hyperlink. What I am trying to do is copy everything and paste it to the destination sheet except for the formulas. I tried to use .PasteSpecial xlPasteAll...
  16. P

    Create a VBA macro that insert/append HTML tag upon highlight of selection

    Hello! I have a some words that I want to be surrounded by <code> </code> tags in my Excel cells, however, I want it to be done without using formula because there is a lot of them and formula is not context sensitive so I want to opt for macro due to its versatility. How do I get it done? (Yes...
  17. D

    Macro to import data from another workbook

    Hello everyone, I'd like to import data from another closed workbook by having a popup that'll let me search for the file, then select the range for which the data exists and import that into my current sheet. The link below is a pretty good representation of what I would like to achieve...
  18. J

    VBA - email body to allow font type, size and colour

    I'd like to be able to customise my automated email with font type, size and colour. I understand .Body needs to be .HTMLBody but not sure how to do the rest. Any assistance would be fantastic. Sub EmailAll() Dim OutApp As Object Dim OutMail As Object With Application...
  19. K

    Can anyone tell me why is this appening?

    Private Sub UserForm_Initialize() Call CallTime_Msg lb_hello.Caption = msg lb_tec.Caption = Tec End Sub Sub CallTime_Msg() Dim mHour As Integer Dim msg As String mHour = hour(Now) If mHour < 12 Then msg = "Good Morning" ElseIf mHour < 18 Then msg = "Good Afternoon" Else msg =...
  20. E

    Debug after running macro

    I have a macro that I have assigned to a button which looks at a certain range of cells formatting, and upon clicking on the button, it copies the cell formatting of the range, and copies it to another range on the same page and also other cell selections on another sheet. I also have some VBA...

Watch MrExcel Video

This Week's Hot Topics

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
Top