haasjoh
11-02-2015, 10:01 AM
Hi all,
quick question to all VBA pros.
I am having a pretty long table in excel, and in one column ( H5 till H2000 or so) I have values 1 to 5 depending on a grading scheme. Now I want a macro that ones I run it looks at each cell starting in H5 and gives a another value betwenn 0 and 25 in another cell
It should basically work like a grading scheme.
If cell contains 1 then 25 in another cell
If cell contains 2 then 20...
If cell contains 3 then 12.5...
If cell contains 4 then 7.5...
If cell contains 1 then 0...
The cell only can included 1,2,3,4 or 5 - so it works like a grading scheme - I know i could do it also with simple formula without the use of a macro, but I have more columns to go later.
So for example if Cell H10 contains 3 i need in the same row (10) but column S or so (can be flexible) - so offset it by about 10 - the value 12.5
Hope it is clear from my description above what I have in mind.
I figured there might be VBA code that can help.
Many many thanks in advance for the person who can solve it.
Rgds,
quick question to all VBA pros.
I am having a pretty long table in excel, and in one column ( H5 till H2000 or so) I have values 1 to 5 depending on a grading scheme. Now I want a macro that ones I run it looks at each cell starting in H5 and gives a another value betwenn 0 and 25 in another cell
It should basically work like a grading scheme.
If cell contains 1 then 25 in another cell
If cell contains 2 then 20...
If cell contains 3 then 12.5...
If cell contains 4 then 7.5...
If cell contains 1 then 0...
The cell only can included 1,2,3,4 or 5 - so it works like a grading scheme - I know i could do it also with simple formula without the use of a macro, but I have more columns to go later.
So for example if Cell H10 contains 3 i need in the same row (10) but column S or so (can be flexible) - so offset it by about 10 - the value 12.5
Hope it is clear from my description above what I have in mind.
I figured there might be VBA code that can help.
Many many thanks in advance for the person who can solve it.
Rgds,