Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using found variant within code
If I use this code to find last used row in a worksheet,
Sub Last_Row() Dim lasty As Long lasty = Range("AP" & Rows.Count).End(xlUp).Row MsgBox lasty End Sub how do I use "lasty" in this line of code to replace the row 200 ActiveCell = Application.SumIf(Range("B2:B200"), "jk", Range("AP2:AP200")) ie I only want to sum used rows |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using found variant within code
Hi Ron
Try ActiveCell = Application.SumIf(Range("B2:B" & lasty), "jk", Range("AP2:AP" & lasty)) -- Regards Roger Govier "Ron Dean" wrote in message . nl... If I use this code to find last used row in a worksheet, Sub Last_Row() Dim lasty As Long lasty = Range("AP" & Rows.Count).End(xlUp).Row MsgBox lasty End Sub how do I use "lasty" in this line of code to replace the row 200 ActiveCell = Application.SumIf(Range("B2:B200"), "jk", Range("AP2:AP200")) ie I only want to sum used rows |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using found variant within code
ActiveCell = Application.SumIf(Range("B2:B"&lasty), "jk",
Range("AP2:AP"&lasty)) Regards, Stefi €˛Ron Dean€¯ ezt Ć*rta: If I use this code to find last used row in a worksheet, Sub Last_Row() Dim lasty As Long lasty = Range("AP" & Rows.Count).End(xlUp).Row MsgBox lasty End Sub how do I use "lasty" in this line of code to replace the row 200 ActiveCell = Application.SumIf(Range("B2:B200"), "jk", Range("AP2:AP200")) ie I only want to sum used rows |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing value of variant | Excel Programming | |||
Variant | Excel Programming | |||
using find with variant? | Excel Programming | |||
Ron, I found some code that works with Lotus Notes | Excel Programming | |||
Find Variant | Excel Programming |