Dear Everyone,
I am wondering if you can write me a VBA code for comparing the value inside a cell.
Thank you for your support,![]()
Please Login or Register to view this content.
Dear Everyone,
I am wondering if you can write me a VBA code for comparing the value inside a cell.
Thank you for your support,![]()
Please Login or Register to view this content.
Like this?
![]()
Please Login or Register to view this content.
Dear rvasquez
thank you for your help, what if i want to find the value in Sheets("sheet1").Cells(i, 1) in Sheets("sheet2"). column "A"
how can i modifies the code?
Simply I want to find the value of Sheets("sheet1").Cells(i, 1) in sheet 2, column 1, it can be in 1st row or 100th row,
Last edited by Cutter; 08-02-2012 at 08:09 PM. Reason: Removed whole post quote
Okay, and do what with the found cell?
Add 1 to column 2, if find again add another 1 i.e. become 2
Last edited by Cutter; 08-02-2012 at 08:11 PM. Reason: Removed whole post quote
I'm sorry from what you provided you just want unique values added to sheet2? If this is not the case could you please revise your attachement and format sheet two to mimic what you would your results to look like?
Thanks!
rvasquez,
No, that right, I have edited the file for what i expected to get.
Last edited by Cutter; 08-02-2012 at 08:10 PM. Reason: Removed whole post quote
![]()
Please Login or Register to view this content.
You could also achieve the same result by placing the formula in B1 and copying it down to the last row
To insert the macro above into your workbook:![]()
Please Login or Register to view this content.
1.Press Alt+F8 on your keyboard
2.Clear the macro name box and type LocateCells in the blank box provided
3.Select the Create option
4.In between the Sub LocateCells() and End Sub copy and paste the above code I have provided. Anything that appears in green is a comment.
5.Exit out of the Visual Basic Window
6.Press Alt+F8 again and this time select the LocateCells macro
7.Select Run
rvasquez,
Thank you for your help,
your code is valid only if same date available in sheet 2 compared to sheet 1. but, what if there is nothing in sheet 2? I found that the code is not working,
I do understand that i can do it through formula be i prefer VBA,
Last edited by Cutter; 08-04-2012 at 11:46 AM. Reason: Removed whole post quote
If it's not found then it should give you a 0.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks