All other macros work properly. The script is also run if a cell value is changed.
XL2K? What's that? :stare:
I want a script to execute when a row is inserted or deleted. I'm using Worksheet_change in my computer (Office XP pro) and it works fine, but on other computers (Excel 2000) it seems that inserting/deleting rows isn't considerated as a worksheet change.
Is it possible?
If so, how could I get around this?
Thank's in advanec;
Thank's! They said to me that it was not possible using attributes, so I didn't take a closer look.
Now it's just how I desired
I made a UserForm in which the user can write what he wants, but I only achieved to insert a big TextBox, which has several limitations. What I'm seeking is a textarea box (like this one where I'm writing right now). As far as I've seen in MVB Help there is no similar control, but I've heard something about Memo.
Do you know anything what that Memo is?
thank's in advance;
It seems it wasn't as easy as I thought. Finally I found this script which detects if a row is inserted or deleted:Code
Private Sub Worksheet_Change(ByVal Target As Range) Static lastValue As Variant Static lastRow As Long Dim lastVal As Variant Dim lastRw As Long lastRw = Cells(65536, 1).End(xlUp).Row lastVal = Cells(lastRw, 1).Value If lastRw = lastRow Then lastValue = lastVal Exit Sub Else If lastVal = lastValue Then Worksheets("Hoja2").Range("A1").Value = 1 MsgBox "You aren't permitted to insert or delete rows within the dynamic range. Please undo any row insertions!" Application.EnableEvents = False Application.Undo Application.EnableEvents = True Else lastValue = lastVal lastRow = lastRw End If End If End Sub
I'm using Worksheet_Change in my Worksheet to react to the changes made by the user, but how do I know if the user just inserted a new row?
Or is there any on_row_change event or something like that?
Ok, first of all... I'm sorry wasting (?) your time with such an elementary question, but I really don't find how to do this:
It's aboaut using reg expressions...Code
My question is how do I make the program read the *€ as a regular expression?
Thank's very much in advance :thanx:
Ok, an example...
Let's say I have a table like this:
I want to make something like a shopping list with this. If I want to buy 3 units of 'Something' at 'Shop2' and 1 of 'Otherthing' at 'Shop3' I will change the table to something like this:
But what if I change my mind? What if I now want to buy 3 units of 'Something' not to 'Shop2', but to 'Shop1'? I want to just have to write '3' in the 'Shop1'/'Something' cell and the original price of 'Shop2' should appear automatically when the value changes:Code
Written by me Changed by program
I hope I explained myself better now...
It seems Worksheet_Change is what I'm looking for, but I'm open to suggestions...
My first post! Let's see how it goes :p...
I'm quite new on VBA althought I've been making some things in Excell. I have several columns which show the different prices a product (rows) is sold, but I also want those columns to be able to register values (quantity of units needed).
I've thought of a funtion which checks the other price columns of the row. If the values are 1, 2, 3 etc they should be set back to the price if the selected cell has been changed to 1, 2 or 3...
Thank's very much in advance