Hi I am trying to make a macro to loop through Column A , which is a date field dd/mm/yyyy
when date changes put value in corresponding row to 100
column to change is L
any help will be appreciated
Graham'
Hi I am trying to make a macro to loop through Column A , which is a date field dd/mm/yyyy
when date changes put value in corresponding row to 100
column to change is L
any help will be appreciated
Graham'
Attach a sample workbook demonstrating what you have described and mock-up your results.
Go Advanced -> Manage Attachments -> Upload
here is a test sample
thank you in advance
Graham
Norie this code didnt work
(1) it said variable not declared so i put in dim arrdata as range
then it said something regarding Array
sorry
Graham
Try this.
![]()
Dim arrData() Dim I As Long arrData = Range("A2", Range("A" & Rows.Count).End(xlUp)) For I = LBound(arrData) To UBound(arrData) - 1 If arrData(I, 1) <> arrData(I + 1, 1) Then Range("L" & I + 2).Value = 100 End If Next I
Last edited by Norie; 08-17-2018 at 01:56 AM.
If posting code please use code tags, see here.
![]()
Sub test() Dim x As String With Range("a2", Range("a" & Rows.Count).End(xlUp)) x = .Columns(12).Address .Columns(12) = Evaluate("if(" & .Address & "<>" & .Offset(-1).Address & ",100,if(" & x & "<>""""," & x & ",""""))") End With End Sub
Thanks Jindon works perfectly and it is fast as well
Much Appreciated
Regards
Graham
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks