bhrigu
08-09-2018, 04:13 PM
Hi,
I am trying to build a macro for the logic below. I am a newbie with VBA and macros. I would appreciate any help.
rwy, rwy2, rwy3, rwy4 are headers for fields in an excel table. They are values in the range of C8:I110. I need them to return "no value" or a configuration number in column J, lets call it "Configuration". I dont know which dimensions to create and how to use them or if we could use some sort of loop.
If
(rwy is empty) or
(rwy2 is empty) or
(rwy3 is empty) or
(rwy4 is empty) or
then print "No Value"
elseif (both rwy & rwy2 have some numerical, date or alphabetic value and are not empty) has value then config1
elseif (both rwy & rwy3 have some numerical, date or alphabetic value) has value then config2
elseif (both rwy & rwy4 have some numerical, date or alphabetic value) has value then config3
elseif (both rwy2 & rwy3 have some numerical, date or alphabetic value) has value then config4
elseif (both rwy2 & rwy4 have some numerical, date or alphabetic value) has value then config5
elseif (both rwy3 & rwy4 have some numerical, date or alphabetic value) has value then config6
end if
Please help any way you can.
Thank you so much,
Bhrigu
I am trying to build a macro for the logic below. I am a newbie with VBA and macros. I would appreciate any help.
rwy, rwy2, rwy3, rwy4 are headers for fields in an excel table. They are values in the range of C8:I110. I need them to return "no value" or a configuration number in column J, lets call it "Configuration". I dont know which dimensions to create and how to use them or if we could use some sort of loop.
If
(rwy is empty) or
(rwy2 is empty) or
(rwy3 is empty) or
(rwy4 is empty) or
then print "No Value"
elseif (both rwy & rwy2 have some numerical, date or alphabetic value and are not empty) has value then config1
elseif (both rwy & rwy3 have some numerical, date or alphabetic value) has value then config2
elseif (both rwy & rwy4 have some numerical, date or alphabetic value) has value then config3
elseif (both rwy2 & rwy3 have some numerical, date or alphabetic value) has value then config4
elseif (both rwy2 & rwy4 have some numerical, date or alphabetic value) has value then config5
elseif (both rwy3 & rwy4 have some numerical, date or alphabetic value) has value then config6
end if
Please help any way you can.
Thank you so much,
Bhrigu