selectionchange

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. M

    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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. H

    Worksheet_SelectionChange MsgBox IF/THEN Statment

    What I am looking to do with this code is I want to look at cells B4:I38 and first see if they have been locked, if so than when a user selects a cell within that range the below message box (in the code) appears. But if the user selects a cell outside of that range than no message appears. So...

Some videos you may like

This Week's Hot Topics

Top