routine

  1. welshgasman

    CreateObject in VBA

    Hi all, From another forum I have spotted a line of code With CreateObject("VBScript.RegExp") Now I was led to believe that if you create an object, you should set it to Nothing at the end of the routine.? However that was always after something like Set objVBSR =...
  2. U

    Why does this email routine work for me and not my client?

    The person I wrote this for and I both work at the same company with the same software, Office 365. The entire macro runs and compiles the data but for the person I wrote does not see the emails. Why won't it display the email for her? Public Sub SendEmailWithAttachments(strContact As String...
  3. H

    Clipboard clears out so must create a separate routine

    I copy data from an outside source and paste into excel. To make things easier, I created a macro that starts by clearing out the current contents of the sheet. Then after that is done, I can copy the outside data, and run the FormInsert routine. I had to create the separate FormInsert...
  4. A

    Search occurrences in a range, and if not found skip their procedure

    Hello all, My code starts with a range that the code filters and there supposed to be left 3 values after filtering. Each value has its own sub-procedure. The range is column "B". I would like the first sub, the one that filters, to check if what is left after filtering is actually there. If...
  5. NessPJ

    [VBA] Routine will not accept my .formula statements

    Hello all, I'm trying to enter 2 formulas in a range of cells in my VBA routine but i keep getting Debug errors upon execution (Run-time error 1004: Application defined or Object defined error). These are the lines of VBA i am trying to use: Range("K2").Formula =...
  6. D

    Checkbox Caption

    I'm fairly new to VBA and have created a checkbox userform and want the caption for each checkbox to be the text in a cell in the worksheet. I keep seeing this line of code and copied it directly into the Userform_Click routine and it won't work. Any help with what I'm doing worng? Private Sub...
  7. sharky12345

    Update column with values but exclude existing

    I'm trying to update a column with values depending on a certain criteria using this; Sheet14.Range("N4:O23").ClearContents For Each cell In Sheet14.Range("B4:B23") If cell <> "" Then If cell.Offset(0, 2) = "" Then Else If...
  8. P

    VB routine to produce message box if value greater then another

    Hi All I'm new to the site. Hopefully I have posted this properly! In the file I'm working in, there are a series of cell into which the user can enter a value of their choice. These cells are all independent of each other so the value are also separate and independent of each other. I...
  9. A

    1004 - Method 'Range' of object '_Worksheet' failed...

    Greetings! Excel 2010 (14.0.7190.5000) 64-bit Win 8.1 Pro I'm getting a 1004 error, "Method 'Range' of object '_Worksheet' failed", when I try to access a WORKBOOK-scope defined-name from a sheet's Worksheet_Activate() routine. Here's the code for the sheet... Private Sub Worksheet_Activate()...
  10. A

    1004 - Method 'Range' of object '_Worksheet' failed...

    Greetings! Excel 2010 (14.0.7190.5000) 64-bit Win 8.1 Pro I'm getting a 1004 error, "Method 'Range' of object '_Worksheet' failed", when I try to access a WORKBOOK-scope defined-name from a sheet's Worksheet_Activate() routine. Here's the code for the sheet... Private Sub...
  11. A

    How does Excel treat numerics differently

    I am testing one value as a multiple of another and suspect that they are stored differently. I have a routine accumulating money values in various denominations. There is a text box for each coin denomination ( eg 50 cent,20 cent, 10 cent etc) called tb10cents, tb20cents etc. I wish to prevent...
  12. M

    Copy chart as picture on another worksheet INTERMITTENTLY fails

    I have a routine that, amongst other things, alters some cell values that in turn determine the content of a series of charts. Each time the charts are changed, the routine copies the chart and pastes it as a picture into another worksheet. I am 99% certain the code is sound but, for some...
  13. P

    Need to specify chart for rescaling as opposed to All charts in worksheet.

    I use the following routine to scale a chart the way I want to display it The routine that I "borrowed" however operates on all chart objects in the worksheet. How do I change the code to only operate on "Chart 6" but leave other charts untouched. Thanks in advance. Sub Format_charts()...
  14. M

    Exiting Worksheet_Change from a sub routine

    Is it possible to exit a Worksheet_change event from a sub routine? So say I Call a sub routine that's triggered within my worksheet_change event can I exit simply from the sub routine or would the code have to go back and finish whatever coding was left after my Calling the sub. Hopefully...
  15. C

    resuming a routine after a userform

    Hi everyone, I have a problem with VBA in Excel 2003. In a workbook I have many routines that they call an userform called “RichiediPwd”. In the routines code I have put: Sub (routinename) …. RichiediPwd.Show …. The userform...
  16. A

    vb routine that asks for user input and then highlight cells PLEASE HELP! :)

    i need some help writing a routine called DryMonth() that will ask for user input and then highlight any cell that has a rainfall less than or equal to the input with a white font and a red background. TIA
  17. T

    VBA Syntax to Simulate Clicking a Control Button

    I have several buttons on a worksheet called Control. When I right click on those buttons, I see different numbers associated with them like "Button 94", "Button 143", etc. The routines associated with those buttons depend on the actual button being clicked by the user and I would like to write...
  18. K

    time chart for baby

    hi, I'm new to this forum, but was hoping someone can help me convert my baby's feeding data into a chart (a frustrated engineer needing to keep her brain active!). I have a log of start/stop/elapsed times for feeding each day and wanted to see if there is any pattern to it. I could add in left...
  19. L

    Possible to reference range established as part of different sub?

    As you may already know...I've gotten to the point where I have established 12 different ranges based on cells values. All of the cells in the ranges are in column B. So my ranges look something like this after the code (lets call it routineA) has run: Rng1 = B2, B5, B9, B50, B60 Rng2 =...
  20. R

    if cell ="",then this macro, repeat all rows

    I am trying to get a macro to run base on the cell value, then go to the next row and potentially run a different macro. Here is the code, please help. Sub Update() Range("AU2").Select For i = 1 To Selection.CurrentRegion.Rows.Count + 1 If ActiveCell.FormulaR1C1 = "s" Then...

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