dim

  1. J

    adding code to an existing macro

    hi all, i have a macro set up which works great and i want to add the below code to it, i know where i need it to fit in but i dont know how to get it to work after Sub MonthlySpreadsheetJanuary() Dim List As Variant Dim LR As Long Dim r As Long List = Array("Cash Movement") LR = Range("C" &...
  2. N

    Function to Get FX Rates

    I am using this function to get FX rates predominantly from USD to GBP. However, it is not always accurate to the specified date. Does anyone use something else which could be more accurate please? Function GetFxRate(CurrencyIn As String, CurrencyOut As String, Dt As Date) As Double Dim strURL...
  3. H

    Excel VBA to rename filesname or folder

    Hi Any idea why this not working? :D Sub ChangeInFolder() Dim OldName As String Dim NewName As String Dim LastRow As Long Dim i As Long LastRow = Range("A65536").End(xlUp).Row For i = 1 To LastRow OldName = Range("A" & i).Value NewName = Range("C" & i).Value Name OldName As...
  4. S

    Runtime 1004 Copy Cells

    Hi guys, hope someone can look over my code and let me know what's wrong with this code. Sub CopyNonBlankData() Dim wkbThis As Workbook Dim lngERow As Long Dim lngLRow As Long Dim i As Integer Set wkbThis = ActiveWorkbook lngLRow =...
  5. A

    Setting Data Validation causes 1004 error.

    Good afternoon all, I have a macro enabled workbook running in Excel 2016. On one tab I've set up a button that runs a macro that will add a new row to a table and set some values in it. Here's the code. Sub ServiceHealth_Tbl() Dim lo As ListObject Dim FinalRow As Long Dim myValue As...
  6. M

    VBA Outlook and Word Library - Late Binding help

    Hi Team, Please assist in converting below outlooks and word library code to late binding. Below is attempted Code. Sub Outlook_Late_Binding() Dim OutApp As Object Dim OutMail As Object Dim ProcurementStatusSh As Worksheet Dim WorkStatusSh As Worksheet Dim...
  7. A

    VBA code to add company logo at the end of the email with attachements

    Hi I have a macro which I wrote from watching a couple of YouTube videos, it works however, I would like to add the company logo at the bottom of the email, the image is saved in W:\company\logo.jpg. My codes are as follows: Sub send_email_with_attachments() On Error Resume Next Dim o As...
  8. D

    Looking to improve efficiency of code

    The following code was taken from a macro I have been working on .... most of which is due to the help of people within this Forum... so thank you. Unfortunately, it takes over 60 seconds to run. I can't blame those who helped me in the past because I never conveyed the entire scope of the...
  9. A

    Variable Range for Array

    Hi All, Hoping you can help please. I have the below code, which use an array of data to autofilter another range of data: Sub CodeSample() Worksheets("Pending Raw").Select Dim range1 As Range Dim var1 As Variant Dim sArray() As String Dim i As Long Set...
  10. L

    VBA URLPictureInsert pics disappear

    Hi there, I have VBA to insert images from a filepath which is derived from a formula. The images insert just fine and are visible for me but if someone else opens the documents they cannot be seen (all settings are correct). I'm assuming I need to embed the images but cannot quite get the...
  11. L

    using sheet code name to call Activate function

    Hi I have workbook which has worksheet called hello or sheet1(hello) that is how it looks like in the vba project window. The code below does not work because of Workbooks(1).Sheet1.Activate but if I changed it to workbooks(1).worksheets("hello").Activate it will work! Why is that? thank...
  12. D

    copy column width using SpecialCells

    Still struggling a bit. I can run the code below but the target workbooks columns are not sized the same as the primary sheet. There seems to be many ways to copy so i think im trying to mix them is why i keep getting a object error. Any suggestion would be helpful in the code below i've...
  13. K

    Copy filtered data from workbook to new workbook

    I am trying to copy filtered data from a .xlsm workbook (an image, headings, filtered data) to a new .xlsx workbook. I found some code that I have modified which copies the data in the active worksheet to a new workbook allowing the user to enter their own title and save as. The issue is that...
  14. A

    transfer data from userform to sheet

    hi guys i have userform contains 35 textbox and 18 combobox i would transfer data to sheet i try make the code but it gives me error this line <tbody> </tbody> <tbody> .Cells(Lastrow, i).Value = Me.Controls("TextBox" & "combobox" & i) the error message could not find the specified object...
  15. J

    Create email with same body but different addresses (using drop down menu)

    So I've got a drop down menu which creates an email. Body of the email is always the same but the addresses and subject change depending on the option chosen from the drop down list. It pulls the email addresses from a table and also inserts the contents of the clipboard to the body of the...
  16. A

    userform listbox add items but not if they are marked cancelled

    When adding items to a listbox, how do i avoid ones marked "Do Not Use" (DNU). This is where I am picking up my listbox contents: Private Sub FillResults() Dim ws As Worksheet Dim rngFound As Range Dim strFirst As String Dim strSearch As String Dim strWSname As String Dim...
  17. D

    Function that counts how many numbers are in a range are between a MIN and MAX

    I am trying to create a function that will count how many numbers are in a range on an excel sheet, and also between a min and a max number that are also on the excel sheet (Without using any excel formulas, Ex. countif). The range on the excel sheet also includes empty and non numeric texts...
  18. D

    Copying from one table to another

    I have some code that used to copy certain columns from every record in a table on one sheet to new rows of a table on another sheet. I didn't change anything but it has stopped copying the rows when I run the code. This is the code: Sub cmdSend() Application.ScreenUpdating = False...
  19. L

    Error accessing 2 shared outlook mailboxes at the same time

    I have 2 shared mailboxes where I retrieve the count of the mails. These 2 shared mailboxes have 2 different mailaddresses. When I combine these 2 codes, it gives the following error: <code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight...

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