Tron57
Board Regular
- Joined
- Sep 26, 2002
- Messages
- 66
im not sure how to phrase this but there must be an eaiser way than what i have below.
sub Fill_months()
dim jan as string
dim feb as string
dim mar as string
'and soooo on
dim Month as byte
Month = Range("a1").value
jan = "January"
feb = "February"
mar = "March"
'and so on
if month = 1 then
range("A2").formula = jan
elseif month = 2 then
range("A2").formula = feb
elseif month = 3 then
range("a2").formula = mar
'and so on
end if
end sub
what i want is cell A2 string formula to be the value of A1 numeric value. and then cell a3 to be a string formula of A1 numeric value +1
for example
in cell A1= 3 user typs than then activates the macro
macro fills out
a2 = March
a3 = April
a4 = May
and so on.. there must be an easy way of doing this?? maybe an array, but im not sure how to do that...
sub Fill_months()
dim jan as string
dim feb as string
dim mar as string
'and soooo on
dim Month as byte
Month = Range("a1").value
jan = "January"
feb = "February"
mar = "March"
'and so on
if month = 1 then
range("A2").formula = jan
elseif month = 2 then
range("A2").formula = feb
elseif month = 3 then
range("a2").formula = mar
'and so on
end if
end sub
what i want is cell A2 string formula to be the value of A1 numeric value. and then cell a3 to be a string formula of A1 numeric value +1
for example
in cell A1= 3 user typs than then activates the macro
macro fills out
a2 = March
a3 = April
a4 = May
and so on.. there must be an easy way of doing this?? maybe an array, but im not sure how to do that...