Hi please see this codes and tell where is problem

Sub test()

Dim mysheet As Worksheet

Dim lr As Integer

Dim selrow As Integer

Dim cat As Integer

Dim x As Integer

Dim counter As Variant

Set mysheet = ThisWorkbook.Sheets(“sheet1”)

lr = mysheet.Cells(Rows.Count, 1).End(xlUp).Row

selrow = Selection.Row

cat = mysheet.Cells(selrow, 1)

For x = 2 To lr

If mysheet.Cells(selrow, 1) = cat Then

counter = counter + mysheet.Cells(x, 2)

End If


MsgBox “Total” &cat& “is” &counter


End Sub

By: eydani

23 thoughts on “VBA

  1. louboutin shoes uk

    I have to express my admiration for your generosity supporting men and women that have the need for help on this important matter. Your very own commitment to getting the message up and down came to be especially effective and have really empowered associates much like me to reach their pursuits. Your entire insightful hints and tips implies a lot a person like me and further more to my colleagues. With thanks; from everyone of us.

  2. golden goose

    I precisely had to thank you very much again. I’m not certain the things I would have worked on without these thoughts shared by you regarding my theme. It has been a very fearsome issue for me personally, but being able to see your well-written approach you resolved it forced me to weep with fulfillment. I’m happier for the service as well as sincerely hope you really know what an amazing job that you are undertaking teaching many others with the aid of your webpage. I know that you have never met any of us.

  3. yeezy shoes

    Thank you a lot for giving everyone a very remarkable opportunity to read in detail from here. It is always very terrific and also stuffed with a good time for me personally and my office mates to search the blog at the very least 3 times in one week to study the fresh tips you have got. And of course, I am also usually astounded with your superb strategies you serve. Certain two areas in this article are ultimately the most beneficial I’ve ever had.

  4. nike air max 2019

    I must voice my appreciation for your kind-heartedness supporting persons who have the need for assistance with in this issue. Your very own dedication to passing the message throughout has been pretty functional and have frequently made many people much like me to realize their ambitions. This warm and helpful report means a great deal to me and even further to my colleagues. Best wishes; from everyone of us.

  5. retro jordans

    I really wanted to type a quick remark to thank you for all of the stunning hints you are posting on this site. My time intensive internet lookup has at the end of the day been recognized with professional points to write about with my great friends. I would assume that we readers are definitely lucky to exist in a wonderful site with very many marvellous individuals with beneficial techniques. I feel truly privileged to have come across your web pages and look forward to some more thrilling moments reading here. Thanks a lot once more for everything.

  6. adidas superstars

    My wife and i have been absolutely satisfied when Louis managed to finish up his researching with the ideas he acquired from your very own blog. It is now and again perplexing to just happen to be freely giving instructions which often others could have been selling. So we keep in mind we have the blog owner to appreciate for that. The explanations you made, the easy web site menu, the friendships you will help to create – it is everything fabulous, and it’s helping our son in addition to the family reason why that concept is enjoyable, and that’s particularly pressing. Many thanks for all the pieces!

  7. supreme hoodie

    I and also my guys came checking the excellent solutions on your web page while all of the sudden got a horrible feeling I never expressed respect to the blog owner for those techniques. All the ladies had been so warmed to read them and already have surely been enjoying these things. Thanks for being quite kind and also for choosing some good areas most people are really needing to know about. My honest regret for not expressing appreciation to earlier.

  8. ferragamo belt

    I have to convey my admiration for your generosity for visitors who really want assistance with this subject. Your personal commitment to getting the solution up and down ended up being extremely significant and have in every case empowered folks much like me to realize their pursuits. Your helpful suggestions entails a great deal a person like me and further more to my fellow workers. Warm regards; from all of us.

  9. moncler outlet

    I am also writing to make you know of the perfect encounter our daughter obtained checking your site. She realized a wide variety of details, which included what it’s like to possess a marvelous giving nature to let others easily fully grasp various hard to do things. You truly exceeded people’s expectations. I appreciate you for supplying these informative, dependable, informative and also easy guidance on your topic to Evelyn.

  10. cheap jordans

    I and also my buddies came checking out the great secrets and techniques located on your website and instantly developed an awful suspicion I never thanked the web blog owner for those secrets. The men ended up warmed to study all of them and already have in reality been using these things. Appreciate your genuinely so considerate and for going for varieties of perfect areas most people are really desirous to be aware of. Our sincere apologies for not expressing gratitude to you sooner.

  11. kyrie 4

    I would like to convey my affection for your kindness supporting men who really want guidance on that subject matter. Your special dedication to passing the solution all over had become exceptionally powerful and have surely helped many people like me to get to their ambitions. Your amazing warm and friendly instruction indicates so much a person like me and extremely more to my mates. Many thanks; from everyone of us.

  12. vapormax

    I precisely needed to thank you very much again. I do not know the things I might have handled in the absence of these information shown by you concerning this theme. Completely was a frustrating difficulty in my position, but being able to see a professional mode you dealt with the issue made me to cry over fulfillment. Now i’m happier for your assistance and as well , trust you find out what a great job you’re doing teaching some other people by way of your websites. I know that you haven’t come across any of us.

  13. adidas tubular shadow

    Thank you for all your valuable effort on this web site. Gloria really loves managing investigations and it’s really simple to grasp why. My partner and i hear all relating to the powerful form you convey informative tactics through the blog and improve contribution from other ones on that subject plus our favorite princess is certainly learning a whole lot. Take pleasure in the rest of the new year. Your conducting a terrific job.

  14. golden goose

    My spouse and i felt really peaceful when Emmanuel could finish off his studies through the entire ideas he gained through the web pages. It’s not at all simplistic to simply find yourself releasing guides which usually many people have been trying to sell. And now we recognize we have got the website owner to thank for that. The explanations you made, the straightforward site navigation, the relationships you can give support to foster – it’s got everything unbelievable, and it is aiding our son in addition to our family do think that article is satisfying, and that’s highly indispensable. Thanks for the whole thing!

  15. kyrie shoes

    I have to convey my respect for your kind-heartedness supporting visitors who really need help with this particular area of interest. Your special commitment to passing the solution across was exceedingly useful and have constantly encouraged workers like me to attain their endeavors. Your personal interesting instruction indicates so much a person like me and even more to my colleagues. Regards; from all of us.

  16. converse outlet store

    I wish to show appreciation to you for rescuing me from this particular situation. Just after surfing through the the net and getting solutions which are not pleasant, I thought my entire life was gone. Existing without the approaches to the problems you have fixed through your entire write-up is a serious case, as well as those that could have in a wrong way damaged my career if I hadn’t noticed your web site. That natural talent and kindness in handling all the details was excellent. I don’t know what I would have done if I hadn’t come upon such a thing like this. I am able to at this time relish my future. Thanks for your time very much for this reliable and sensible help. I won’t think twice to refer your blog post to any individual who should have assistance on this area.

  17. zx flux

    This web site is really a stroll-by for all the information you wished about this and didn抰 know who to ask. Glimpse here, and you抣l positively uncover it.

  18. yeezys

    Can I just say what a aid to find someone who really knows what theyre speaking about on the internet. You definitely know the best way to bring an issue to light and make it important. Extra people need to read this and perceive this side of the story. I cant imagine youre no more in style since you definitely have the gift.

  19. off white jordan 1

    The next time I read a blog, I hope that it doesnt disappoint me as a lot as this one. I imply, I do know it was my choice to learn, but I truly thought youd have one thing interesting to say. All I hear is a bunch of whining about one thing that you could possibly fix for those who werent too busy looking for attention.

Comments are closed.