Hello,
Hopefully the answer to my question will be a quick one.
I have a macro that tries to find account 600000, if it finds it, the code needs to insert 12 rows above the account number row and I need to enter Jan-Dec in those 12 freshly inserted rows (column B). My code is working fine up to the point where I'm trying to insert Jan-Dec in the 12 new rows. I'm using the code below and it seems to work fine if I wanted the 12 months entered horizontally, but I can't get it to work when trying to populate the cells vertically, I get "Jan" in all 12 months!
code that works to display the months horizontally:
Cells.Find(what:="600000").Offset(-12, 0).Resize(1, 12).Value = Array("Jan", "Feb", "Mar", "Apr"...,"Dec")
I thought I could flip the Resize parameters around and it would display the months vertically...but I got 12 Jan's instead
code that doesn' work to display the months vertically:
Cells.Find(what:="600000").Offset(-12, 0).Resize(12, 1).Value = Array("Jan", "Feb", "Mar", "Apr"...,"Dec")
Is is possible to use =Array(...) to have the results displayed vertically? Or maybe I need to write my code another way?
I appreciate any insight you might be able to provide.
Thanks kindly
Hopefully the answer to my question will be a quick one.
I have a macro that tries to find account 600000, if it finds it, the code needs to insert 12 rows above the account number row and I need to enter Jan-Dec in those 12 freshly inserted rows (column B). My code is working fine up to the point where I'm trying to insert Jan-Dec in the 12 new rows. I'm using the code below and it seems to work fine if I wanted the 12 months entered horizontally, but I can't get it to work when trying to populate the cells vertically, I get "Jan" in all 12 months!
code that works to display the months horizontally:
Cells.Find(what:="600000").Offset(-12, 0).Resize(1, 12).Value = Array("Jan", "Feb", "Mar", "Apr"...,"Dec")
I thought I could flip the Resize parameters around and it would display the months vertically...but I got 12 Jan's instead
code that doesn' work to display the months vertically:
Cells.Find(what:="600000").Offset(-12, 0).Resize(12, 1).Value = Array("Jan", "Feb", "Mar", "Apr"...,"Dec")
Is is possible to use =Array(...) to have the results displayed vertically? Or maybe I need to write my code another way?
I appreciate any insight you might be able to provide.
Thanks kindly