target.address

  1. E

    VBA Target.Address for multiple cells

    Hello, I have the below code that works perfectly if you enter/copy data one cell at a time. But I copy/paste multiple cells all the time, at which point the code below gives me an error. Is there a way to adapt the below code to work with multiple cells changing at the same time? Private Sub...
  2. W

    need to add cell to this VBA code

    Need to add Cells D7, F7, H7, J7, L7, N7, P7, R7 can't get it to work. Private Sub Worksheet Calculate() If Target.Cells.Count <> 1 Then Exit Sub If Target.Address <> "$B$7" Then Exit Sub If (Target.Value >= 0) And (Target.Value < 0) Then Exit Sub Pictures("Picture 7").Visible =...
  3. F

    How to save macro workbook to a new workbook as xls with same formats

    Hi All, I use the below code, will be reduced to smaller level, I am just making the rows hide, if the cell value is blank. Also, i was trying to save the file in a path, however when we click on Alt F11, it still shows this code. Private Sub Worksheet_Change(ByVal Target As Range) If...
  4. D

    VBA explanation please.

    Can someone explain what this code is doing? thanks in advance. Private Sub Worksheet_Change(ByVal Target As Range) 'Updateby Extendoffice 20160725 Dim xCell As Range If Target.Address <> Range("C54").Address Then Exit Sub Application.ScreenUpdating = False For Each xCell In...
  5. BlakeSkate

    [VBA] Import Sheet From File Path & Cell

    I have a sheet macro on a sheet named "Program Start" that opens various userforms based on which cells are clicked as well as switches off the sheet. When the userform portion of the code is completed it returns the sheet selection back to Program Start. If Target.Address = "$H$2" Then...
  6. C

    Combine two Private Sub Worksheet_Change formulas

    Good morning, I am in need of combining two Private Sub formulas together. Individually they work, and are as follows: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$F$2" Then Range("F3").Value = "" End If If Target.Address = "$F$3" Then...
  7. A

    Loop through ranges inside condition

    Hello There, I have the following code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$B$12" Then Range("C12").Value = "Please Select..." End If If Target.Address = "$C$12" Then Range("D12").Value = "Please Select..." End If...
  8. L

    Amy possible that i can create a simple VBA based of repetitive VBA

    Hello, everyone.. i need some help to make this repetitive VBA into a very simple VBA My repetitive VBA were shown as below If Target.Address = "$L$6" Then a = Sheets("Price Record").Cells(Rows.Count, "A").End(xlUp).Row + 1 Sheets("Price Record").Range("A" & a).Value =...
  9. D

    Procedure too large error

    Hello, I have a worksheet selection change event code which is basically the same code copied 21 times with the only difference being the row number. Each row on the worksheet is for a different student. I am getting a "procedure too large" error and need to shorten the codes. The code...
  10. R

    Trouble with two Worksheet_Change codes

    Good Afternoon, I'm new to VBA codes and need some help. I would like to have the two code below operating on the same worksheet. I've got the first one working but not sure how to add the second. Some help would be greatly appreciate. Code 1) Private Sub Worksheet_Change(ByVal Target As...
  11. I

    VBA- Navigation List

    Hello! I am trying to build a macro to be able to navigate in one sheet. It seems too complex to me, as I don't have programming background. The idea is the following, I have this summary list: <tbody> Column G Column I 100 USA 120 EU 140 JAPAN ... ... </tbody> Column G contains the...
  12. C

    Multiple cells to open one userform

    Still relatively new to coding. I'm trying to build an equipment schedule so I know where gear is going/has been. I'm trying to set it up so I can double click the piece of equipment which will in turn run a user form. It works for my first line (A3), but not for anything after. Private Sub...
  13. R

    Skipping vb code

    Hi. I am not a VB programmer, but I expect the answer would be easy for those who are. I have a simple VB routine running on a spreadsheet that clears the contents of a cell when the value has been changes. I would like to add a checkbox to my spreadsheet to turn on or off this feature...
  14. C

    Help to edit VBA code for Dropdown list for multiple selection?

    Here's my code: If Target.Address = "$F$13" Or Target.Address = "$F$14" Then. Now my problem is I have to make it up to "$F$1000" and it's very frustrating to enter it one by one. Is there away to make the code shorten? Thanks
  15. E

    Clear Contents, Independent Instances; Separate Worksheet VBA

    Hello. New to the MrExcel. I'm currently building a form that requires separate instances of cells being cleared based on cells from other worksheets changing. Private Sub Worksheet_Change(ByVal Target As Range) 'When E1 changes, E2 clears, and c20, d20 .... j20 all clear. If...
  16. A

    ActiveSheet.Name not working for some users

    Hi everyone, I have a report that updates data when the dates are changed either in field C2 (from) or field F2 (to). It goes like this: Private Sub Worksheet_Change(ByVal Target As Range) Dim TValue As String, TAddress As String, Tsource As String If Target.Address = "$C$2" Or Target.Address...
  17. J

    Target.Address is a merged cell

    Hi, I am struggling with the VBA code below. The code works fine until I delete the contents of the target cell, this does not have the desired effect of hiding the row below. I believe this is due to the target cell B315 being merged with B316. Any ideas how I can rectify this? Thanks, Justin...
  18. R

    VBA multi-select dropdown menu help

    Hi, I have the below code, which enables me to select multiple options from a drop-down menu. However, I want to amend this to column I, J and K - but the code is not letting me go any further than I37 (it goes red). This does coincide when it moves to the next line if this could be the issue...
  19. C

    Compile error - Procedure too large. Code assistance needed.

    Assistance needed to break this Code down to a smaller version as I am getting a Compile Error - Procedure too large. Current Code: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$BA$4" Then Shapes("A 1").Width = Target.Value * Range("BA157") End If If...
  20. H

    New to Macros Help with Range apply to whole column/row not one cell

    Hi I'm working on a simple worksheet with 6 columns: A = Buy Price (pre populated) B = Sell Price (To be input by User or Calculated) C = Amount (pre populated) D = Buy Value ( A * C ) E = Sell Value (To be input by User or Calculated) F = Pecentage (To be input by User or Calculated) Basically...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top