Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I have the code below, but I do not know how to adjust the syntax.
How do I get 'lastdata' to be equal to, greater than and equal to, less than two cell values? cheers ste Sub findlatest() Application.ScreenUpdating = false Dim myrng As Range Dim myfound As Range Dim lastdata As Long Sheets("Main").Select 'Problem here! lastdata= (= Sheets("Main").Range("I65536").End(xlUp).Value And lastdata <= Sheets("Main").Range("J65536").End(xlUp).Value ) Set myrng = Sheets("BaseData").Columns("B:U") Set myfound = myrng.Find(What:=lastdata, After:=myrng.Cells(1), LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False) Sheets("Main").Range("L65536").End(xlUp).Value = myfound.Row - 1 Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF, THEN SYNTAX | Excel Worksheet Functions | |||
VB Syntax | Excel Discussion (Misc queries) | |||
If then syntax | Excel Worksheet Functions | |||
help in syntax | Excel Programming | |||
Need some syntax help, please | Excel Programming |