target.value

  1. 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 =...
  2. P

    Excluding a column from VBA

    Hi, Im very new to VBA and have a code that enables me to select multiple options from drop down. How can I modify this to exclude a certain column, say column B? Private Sub Worksheet_Change(ByVal Target As Range) Dim xRng As Range Dim xValue1 As String Dim xValue2 As String If...
  3. H

    Hide rows based on data validation dropdown list.

    Hi, I am looking to hide/unhide rows based on a drop down validation. The below codes works for one drop down however I have a further 2 drop downs that need to hide different rows. any help will be greatly appreciated. Private Sub Worksheet_Change(ByVal Target As Range) 'Updated by...
  4. I

    Additional code needed for existing working code

    Evening, I am using the working code supplied below. So this code works like so. If i enter in a cell in column D the number 3 once i leave that cell it changes to the word HUTTON STORES & also then in the next cell to the right of it the number 6, this is fine BUT if i forget to enter the...
  5. F

    VBA: Hide rows based on column A

    This code works fine, but as I need to adjust my sheet rows and which ones should be visible and/or hidden, I would like to put a number in column A to represent the grouping. Private Sub Worksheet_Change(ByVal Target As Range) Me.Cells.EntireRow.Hidden = False If Not Intersect(Target...
  6. H

    Value Odd in cell Vba Code....

    Hey i need some help with this code Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) On Error Resume Next If Not Intersect(Target, Range("F10:R19")) Is Nothing Then Target.Value = Target.Value + 1 Target.Value = Target.Value / 2...
  7. P

    Macro Buttons change colour when pressed

    Hi, Looking for a solution to my Macro button (shape) problem. I have the below code which will colour a depressed button. Problem is this will only work for 1 button and i have 12 that i want it to work for. The idea would be that the button stays depressed until another button is selected...
  8. I

    Expand on current code in use

    Hi, Supplied is the current code in use. I wish to expand the code to apply a number in the corresponding cell in column E Target cells are currently in column D "name of shop" & now wish to also add in column E "mileage to that shop" Currently if i enter 1 in the target cell i then see...
  9. I

    Code lags when run

    Hi, On my worksheet called G EXPENSES i have the following code in use but when i leave the cell i dont see the name appear straight away but more like 2 seconds later. Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("D5:D35")) Is Nothing Then If...
  10. H

    VBA doesn't work for multiple data validation entries

    Hi all. Got this VBA which is supposed to enable the adding and removing of more than one name from within the same cell. It's supposed to behave that if you click the first name it puts it in, if you then click a second different name, it puts that in too, if you come back next week and select...
  11. F

    VBA: Double click choices from a range

    I'm using a doubleclick event with the code below and all works well with the range of G2:G5. At times the range could be longer, but not sure how to rearrange this to accomodate for say a range of G2:G10. The range contains text. If Target.Address = "$H$6" Then If Target.Value...
  12. M

    VBA Code to clear contents Not formulas on spreadsheet

    Hi can anyone help please, I have the following code that clear the contents as well as the formulas on my spreadsheet. Can any tell me please how not to clear the formulas . Thanks Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'Modified 6/18/2019 3:09 PM...
  13. T

    Excel visual basic code works on one worksheet but not on another

    This code works in one TAB (sheet) but not in another. Any help appreciated! Private Sub Worksheet_Change(ByVal Target As Range) 'Code by Sumit Bansal from https://trumpexcel.com ' To allow multiple selections in a Drop Down List in Excel (without repetition) Dim Oldvalue As String Dim Newvalue...
  14. C

    Alternate between two characters by selecting

    Hi all, I found this code to alternate between two characters (I use it to go around the autofill checkbox problem) it works great except it changes all the cells in the column instead of just the selected cell. P.S. I'm a real noob in coding, so please be specific :) Private Sub...
  15. M

    Trouble Repeating VBA Code

    Hello, I'm new to VBA coding. I found a very useful code that allows me to produce a checkmark when I double click on the task I've just completed. However, for some reason, I can't repeat the action. See code below: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As...
  16. W

    change trigger from Worksheet_Change to Woorksheet_Calaculate

    I'm trying to change the trigger from Worksheet_Change to worksheet_calculate cannot get it to work. Private Sub Worksheet_Change(ByVal target As Range) If target.Cells.Count <> 1 Then Exit Sub If target.Address <> "F13" Then Exit Sub If (target.Value >= 0) And (target.Value < 0) ThenExit...
  17. E

    Rows Keep Unhiding

    Hey everyone, So in my worksheet I have a lot of drop downs. Some are dependent on some are not. A few of the rows I have hide if "No" is selected in the drop down. After I use another drop down, the row un-hides itself. Does anyone have a solution to this issue? Thanks in advance. Here is a...
  18. tlc53

    VBA Code - Amend to include more references

    Hi there, Can anyone help me amend this VBA code to include more than one reference (if possible)? It currently refers only to D12 but I want to add another nine references - D68, D124, D180, D236, D292, D348, D404, D460 and D516. Thank you! Private Sub Worksheet_Change(ByVal Target As...
  19. W

    Excel VBA delete picture

    I want to delete picture based on cell value If Target.Value = "Yes" Then delete RedArrow picture should only show GreenArrow picture not both If Target.Value = "No" Then delete GreenArrow picture should only show RedArrow picture not both<strike></strike> Private Sub Worksheet_Change(ByVal...
  20. E

    Hiding rows based on a cell value with multiple values

    Hey everyone, I'm trying to write a code that hides rows based on cell value, but with a twist. The cell that it is based off of is a drop down. I have it to where you can select multiple options within the cell. I have a list of colors in the drop down and at the end I have a "Special Color"...

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