sameple workbook with sheets of sample data and result is attached ,kindly assist
Subtract sheet 2 values from sheet 1 and give them in result
sameple workbook with sheets of sample data and result is attached ,kindly assist
Subtract sheet 2 values from sheet 1 and give them in result
Last edited by ROHAN999; 09-11-2018 at 01:33 PM.
Plz somebody assist
Shall i modify or upload other sample
Plz somebody take it up
Hi Rohan,
Looking at your problem, it doesn't make sense to me. You have two sheets with Employee numbers and Pay on each sheet. Are these sheets different days of work? The Emp No on each sheet may not be the same. If you subtract the values of sheet 2 from sheet 1 the result for employee 9 should be negative 2 and not positive 2.
So - if your result sheet is correct, you want to add the values from both sheets but that is not what you suggest in your question.
This may be why you aren't getting much help with this.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
There is no structure in your example file. A possible solution in the appendix.
Sample data.xls![]()
Please Login or Register to view this content.
thanx vraag
your code works fine as the result given
but by my mistake i left (-) minus sign in one
actually the result would be :
emp no ... pay
2 ... -9
9 ... 2
13 ... 3
124 ... 4
As employee 2 is not there in sheet 2 so it will be subtracted from zero so negative
rest everything is fine.
Kindly modify the code a bit. i apologize for my mistake in showing result.
Last edited by ROHAN999; 09-15-2018 at 02:59 PM.
with a small change
![]()
Please Login or Register to view this content.
.Cells(1).CurrentRegion.Sort .Cells(1), , , , , , , 1
Error msg coming here sir
Unable to get the sort property of range claśs
Except this code is working fine
If your data does not start in A1 then you will have to adjust the range. Cells(1) is Range("A1")
https://www.excel-easy.com/vba/examp...entregion.html
Thank you sir
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks