Hello -
See code in Module 1 of attached workbook. The same procedure needs to run in cells H3:H5 based on values selected in cells A3:A5. As a new student of VBA, I'm trying to figure out how to shorten this code?
Thanks!
Hello -
See code in Module 1 of attached workbook. The same procedure needs to run in cells H3:H5 based on values selected in cells A3:A5. As a new student of VBA, I'm trying to figure out how to shorten this code?
Thanks!
Hello Grilleman,
Do really need to do this VBA? This is much easier to do using formulas.
I removed all the code and then added a new named range "Required" with the values needed for each part (1 or 2). In column in column "H", the following formula was added and dragged down:
=D3*E3*INDEX(List:Required,MATCH(A3,List,0),2)
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
The above should work as a replacement for the sub you did.![]()
Please Login or Register to view this content.
edit: Updated the code to search the entire column A for values and put the corresponding value into column H.
Last edited by 111StepsAhead; 04-11-2012 at 01:22 PM.
Awesome - works great! Now I just need study what you did differently to see if I can understand it. Thank you very much.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks