Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Selected Items
Hi all,
I have Rec_No in my column A and amount in Column B something like Rec_No Amount 1 50 2 25 4 35 8 200 10 100 11 15 12 20 I want the user to select From and To rec no and add only items between those nmbers including start and end no. If I use a UserForm with Two text boxes users can enter start receipt and end receipt no. But How can I select those items only and sum that selection and dispaly the result in the user form? TIA soniya |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Selected Items
Dim tot as Long, lngStart as Long
Dim lngEnd as Long, i as Long tot = 0 lngStart = clng(textbox1.Text) lngEnd = clng(Textbox2.Text) for i = 2 to 8 if cells(i,1)= lngStart and cells(i,1)<=lngEnd then _ tot = tot + cells(i,2).Vaue end if Next Textbox3.Text = tot -- Regards, Tom Ogilvy Soniya wrote in message ... Hi all, I have Rec_No in my column A and amount in Column B something like Rec_No Amount 1 50 2 25 4 35 8 200 10 100 11 15 12 20 I want the user to select From and To rec no and add only items between those nmbers including start and end no. If I use a UserForm with Two text boxes users can enter start receipt and end receipt no. But How can I select those items only and sum that selection and dispaly the result in the user form? TIA soniya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying only selected items to another worksheet | Excel Worksheet Functions | |||
Items, when selected doesn't appear!? | Excel Discussion (Misc queries) | |||
named range, data validation: list non-selected items, and new added items | Excel Discussion (Misc queries) | |||
Is it possible to copy only selected items to another worksheet... | Excel Worksheet Functions | |||
selected items flash | Excel Discussion (Misc queries) |