Macro

chazzerman01

Board Regular
Joined
Nov 18, 2019
Messages
65
is it possible for a macro to run if the active cell value is different to the value above it
 
Oooh - one more thing that's just occurred to me: The act of inserting a row will invoke the Change function, so the test needs to be that the target cell is the first column of the last row and the cell has a value.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  1/8/2020  10:27:51 AM  EST
Dim tbl As ListObject
Set tbl = ActiveSheet.ListObjects("Table6")
If Not Application.Intersect(Target, tbl.ListRows(tbl.ListRows.Count).Range(1, 1)) Is Nothing and Target.Value<>"" Then
Application.EnableEvents = False
Call Resize_Me
End If
Application.EnableEvents = True
End Sub
Fat Boy:
Thanks for your input it worked for me. I use sheet change events but never one when using a Table.
I need to go. So if you could make any changes your now suggesting would be great.
I will be off line for several hours.
Thanks. I learned something new today.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
(y)It's a collaborative effort.

The code in my previous post contains the updated test to check the changed cell has a value.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,539
Members
449,038
Latest member
Guest1337

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