set

  1. G

    If/Then statements with three outcomes

    Hey all, I have a Userform with textboxes in it. A user can input up to two characters in each. How the values are formatted is dependent on how many characters there are i.e. Empty Textboxes are handled one way, single characters ("A") are handled another and 2 letters ("AB") are handled a...
  2. J

    An easier way than this to SQL update ?

    Hi, i have the following which works but is there an easier way if the worksheet data matches the table? ie same no of columns as with 20+ columns to update it gets tedious typing it all out. Sub updateSQL() Application.ScreenUpdating = False var1 = Sheet3.Range("A2") Set cnn =...
  3. S

    email help with adding content

    Hi All So trying to create an email, see code below, in particular the red text. I have data in columns N,O,P. but this can vary each time from 1 row to 30 rows. My example below showing 5 rows. What im wondering is if somehow i can loop, however many rows there happen to be per macro run...
  4. A

    Use a specific set of numbers x times to equal a set value

    Hello Please could someone help me to do this (I have searched the internet and found nothing or more than likely, am not using the correct terminology :eeek:) ... I want to use the numbers in Column F the D2 number of times to Equal C2 (or at least as close to it as possible if the actual...
  5. D

    VBA to insert a custom image

    I have code to insert a set image. Could someone tell me how to alter it so it can insert a custom image please? Sub cmdJakeSig() Dim shp As Shape Set shp = ThisWorkbook.Worksheets("sheet1").Shapes("textbox4") Sheets("Sheet2").Shapes("ImgJ").Copy Sheets("sheet1").Paste...
  6. A

    Find value in worksheet, copy to new row of table in second worksheet

    Hi all, I'm new to the forum and VBA, so thanks in advance for the help! This is what I'm trying to do 1) import data from a text file into a data pane that will feed into a dashboard, 2) search for keywords in the data to find cell references, and 3) copy this data into a new row of an...
  7. H

    opening all .msg files from a folder and saving them as pdf

    Hi, i have saved almost 500 mail copies in a folder. the task is to open all the mail copies and save them as pdf. the below code loops through the folder. however, i need help so that i can save each mail item as pdf. help would be highly appreciated Sub bla_OK() Dim objOL As Object Dim Msg...
  8. J

    Solution not needed - just clarity on a piece of this code!

    Hi folks, I got the below code online somewhere a a few months back and its recently come in handy for something I'm doing (copying every other row and pasting it elsewhere). However, I'm new to VBA and do not understand 1 thing (which is a problem since I'll need to troubleshoot): why does...
  9. E

    VBA: Trying to pass Cells to Function Range parameters but is passing values instead

    This is a small part of a bigger project which iterates through spreadsheets using Cells and Row and Column values. It is easier to manage than working with Ranges and String values (e.g. "A1"). In the example below, I'm trying to pass the Cells as ranges, and then the method will evaluate the...
  10. R

    Intersect(Target, TargetField) run-time error (1004)

    Dear all, I am getting a run-time error for this code, can you help tell me why and how to fix it? Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If ActiveSheet.Name <> "Form" Then End Dim Form As Worksheet Dim Data As Worksheet Set...
  11. S

    Strange attachment on automated email

    Hello, I have a macro that automatically sends an email with a copy of the workbook as an attachment. I recently made a slight change to add an extra cell value on to the name of the attachment and since then a number of users when they send the email have additional system file attachments on...
  12. T

    Replace array formula with VBA

    I am trying to replace the evaluate method with "only VBA". This first piece of code is a "normal" index match, in that there is only a single criteria and so is entered simply by pressing the Enter key. a and b return the same value, as expected. Dim IndexRng As Range Set IndexRng...
  13. NewOrderFac33

    Correct Qualification for Cells()

    Good afternoon, After battering my head all afternoon with various permutations of the below, I'm conceding defeat and throwing myself on the mercy of the Excel Gods Dim StatsSheet As Worksheet Set StatsSheet = Worksheets("Stats") Dim TransSheet As Worksheet Set TransBook =...
  14. L

    Macro for Outlook Email Signatures

    Hello Experts! I am using the following to successfully create an email and attach a pdf to it. All works great, except the email signature does not show. I believe the signature is being replaced with the body text. outlookmailitem.body="Hello,"..... I am very new to macros (less than...
  15. V

    Excel not responding when run macro on the shared workbook

    Need help on below. Basically, I want to combine all the data from worksheets into one worksheet. And this workbook is shared and will be used by multiple users at the same time and save the files before combine. However, when run the macro, it is not responding. Code: Sub Combine() Dim J...
  16. S

    Indirect within VBA

    Hi, I have some code that sends emails based on a range of cells however I want to make the reference indirect as sometimes there will be 5 rows to send and others there will be 25 rows. The below code works fine I just need help on the row that says " For Each cell In ws.Range("A2:A2")", how do...
  17. T

    Index/Match with OR Function

    I need one of my match criteria to be an or statement. I am currently using the below =INDEX($I$37:$I$1128,MATCH(1,INDEX((D37=$D$37:$D$1128)*(F37=$F$37:$F$1128)*($G$37:$G$1128="Base"),0,1),0)) I want the last set to look for "Base" or "Allowance"...
  18. S

    VBA solution to create worksheets based on cell value and then copy data to its new worksheet

    Hello, I'm looking for some code that will: 1. Evaluate my data set in my "test" worksheet. The header for my data set begins in worksheet("Test"), cell A3, and the size of the data set varies weekly. 2. Create new worksheets (and name the new worksheet) based on the cell content is the...
  19. P

    Email BODY error lines all in red

    Hi Please can you help on the code below, this is in my command button but the email body is all in red, please can you help? Private Sub CommandButton3_Click() Dim aOutlook As Object Dim aEmail As Object Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String Set aOutlook =...
  20. R

    Blank Lines in Email Body

    Hello all, I have a code to generate a outlook email based on cells. I can generate the email fine but for some reason I have two blank lines between the email body text and my signature. Another slight problem is the font size. When I define to 11, it shows as 10. I tried to change to 12 and...

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top