1. S

    Change a WorksheetSelectionChange to run once

    Hi! I have the following code on a sheet, this is a heavy workbook and I'm worried if its continuously running with every click it will slow down the user. How can I modify this to run only on the first click on the ActiveWorksheet, or so i can assign it to a button to be only run when clicked...
  2. Caleeco

    Call Module Subroutine from SelectionChange Event

    Hello, I'm having a code structure issue, so the code below is just representative of the problem. I have several sheets which I would like to have a SelectionChange Event trigger some code to run. There is one routine that I have that needs to run regardless of which SelectionChange event...
  3. L

    Selective elimination of code execution.

    In the code below, recording TO respective sheets works well... recording FROM respective sheets changes the value in B3 thus execute the recording TO respective sheets again... the former is essential, how to stop the latter ? Private Sub Worksheet_Change(ByVal Target As Range) Dim myWS As...
  4. F

    SelectionChange VBA Code Help, conditionals and time values OR use comma separated string of integers to select cells in a column

    tldr: I need code that, on selection of any cell in F8:F27, will add cells corresponding to the numbers from the third position of the comma separated string where cell E10 is the first number and E29 is the 20th number, so selecting F8 will add E10, E11, E12, E14, E15, E21 and E27 to the active...
  5. S

    Issues with "Private Sub Worksheet_SelectionChange(ByVal Target As Range)" - Code restarting from pasting

    Hi All Have a complicated sheet that does things on the fly as the user changes fields and enters data etc etc. To do this I use: Private Sub Worksheet_SelectionChange(ByVal Target As Range) on Sheets(1) Which as you know runs the code whenever the selection changes on the sheet, which is...
  6. L

    General Guidance for 10 nested if else

    Hi Everyone, I'm need some advice for nested if else. I needed a 10 item if-else situation and I am aware that the limit is 7. Plus I need it to continuously need to check value such that if user changes values, the if-else statements will auto adjust to new message(while retaining the ability...
  7. L

    VBA unable to copy and paste with selectionChange &unlocking/locking worksheet

    Hi Everyone, I am having problems copy from a different workbook into my current workbook. I can copy but i can't paste even within the same workbook. I've isolated down to my coding with Private Sub Worksheet_SelectionChange(ByVal Target As Range). I suspect it has something with me unlocking...
  8. R

    Hide sheets not working from User Form

    Hi - new to this and pretty useless with code, so hoping somebody can help. I have a 'Dashboard' with multiple tabs for different uses. I had in my Welcome tab a drop down with 2 options for a submission type. when I select Unitised, it hides the Time & Materials tab as I don't need this one. If...
  9. F

    VBA Lock Cell in row if yes in selected

    Hello, I have the following code to lock the entire row, if the cell selects Yes, but how can I just lock the row from column a to Cd if cell.value is yes. I also then want to say if cell.value="No" , unlock the row and if it's "" do nothing to the row. Private Sub...
  10. G

    VBA Worksheet_SelectionChange

    Hi All, I currently have a piece of code which if I select a certain cell (F6) it will show a userform. I need some help modifying this code that if the cell has a value then the userform won't popup meaning that it will only show when the cell is blank. This is the code I currently have...
  11. V

    Need help understandig why something works in VBA, and something else doesn't

    These work: Private Sub Worksheet_SelectionChange(ByVal Target As Range) With ActiveSheet.CommandButton1 .Top = ActiveWindow.ScrollRow * Rows(ActiveWindow.ScrollRow).Height - 14 End With End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim intCellHeight...
  12. mrMadCat

    Run Macro is there is activity with the excel workbook

    Hello. I need to run a macro that reacts on activity showing that user works with the workbook: selecting cells, refreshing pivots, changing formats, copy-pasting etc. I didn't find any universal function (if there is any please say). But I've found this to be quite suitable for me because most...
  13. R

    Select Case Target.Address for range of cells

    Hi I have a working code to make a calendar pop up when ever someone selects a specific cell. However I would like to make it work for whenever a cell in a range is selected ("G2:G3000 "I2:I3000" "J2:J3000 "L2:L3000") or anywhere in column G, I, J, and L. The code I have at the moment will...
  14. J

    Copy and Paste problems with SelectionChange VBA event

    I have build a workbook for pricing product. The VBA behind the worksheet uses the SeletionChange event to up date the pricing when new data is entered. This has worked well, except that I now need to delete some data before the pricing is updated. I added a couple of lines of code to delete the...
  15. W

    If CutCopyMode = True coding

    I'm experiencing an issue as to where I've got a SelectionChange macro set up, I can't change cells while keeping a range in CutCopyMode (I assumed this was because that code enters formula in cells, but even when it doesn't, it still cancels CutCopy). Can anyone think of a way to solve this? I...
  16. C

    Add a button to a table row if there is a value in the first table column

    I have the following VBA: Private Sub Worksheet_SelectionChange(ByVal Target As Range)Dim btn As Button Dim t As Range If Target.Address = "$B10:$B103" Then If Target.Value <> "" Then Set t = ActiveSheet.Range(Cells(i, 9), Cells(i, 9)) Set btn = ActiveSheet.Buttons.Add(t.Left, t.Top, t.Width...
  17. S

    VBA SelectionChange on specific cells, copy into another sheet

    I'm new to writing VBA but I think I'm close to something. I want a macro that will run if a cell is changed in the range F10:F31. I want it to put in a different sheet the text of the cell address " Updated On " and the date. I think I'm close to something, but this isn't running. Private...
  18. T

    VBA - Trigger a macro when ANY cell in column A is selected

    I haven't found exactly what I need on the boards, so hope someone can help. I have a macro that refreshes a dataset from SQL, then creates a new sheet with some of that data placed and formatted as desired. My issue is that after that macro runs, I need to run another macro when any cell in...
  19. P

    VBA selection change event not working

    I am trying to create a cell that updates whenever a cell within a set range is selected. The cell will be changed to the selected cell's value. However, I am having problems with the selection change event. Here is what I have so far: Private Sub Worksheet_SelectionChange(ByVal Target As...
  20. K

    Sort a list by drag and drop using VBA event handlers

    Hello All, I have built a sheet that allows the user to sort a table of data. Rather than using sort values, I am replicating a drag-and-drop with a single click to select the row and another to insert it at another place in the table. The best way I can come up with uses...

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
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 "".
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