RastaBananaa
New Member
- Joined
- Apr 23, 2018
- Messages
- 8
Hi All,
Hope you could help me with yet another problem.
So I need to create a usage statistics report. As part of the report, I want to create a monthly trends chart. I have figured out a way to do this without any problems. The problem I cannot figure out is how to tell VBA to not create the chart if there is only one month.
So far I have no idea/code of how I am trying to achieve this.
The way I could start it is by doing the following:
Cells.Find(what:="Monthr", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
The above would find the months column and move to one row down. But then I do not know how to make vba look through all the rows in this column which contain data and see if there is more than one month, skip the chart creation.
All the columns are dynamic and so I cannot have a defined location(as in C6 for example) from which the data can be taken. I do however have two columns, a months column(contains numbers 1-12) and year and month column(contain values jan-18 through to dec-18.... in this exact format)
I hope one of you knowledgeable folks can help.
Thank you in advance!
RastaBananaa
Hope you could help me with yet another problem.
So I need to create a usage statistics report. As part of the report, I want to create a monthly trends chart. I have figured out a way to do this without any problems. The problem I cannot figure out is how to tell VBA to not create the chart if there is only one month.
So far I have no idea/code of how I am trying to achieve this.
The way I could start it is by doing the following:
Cells.Find(what:="Monthr", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(1, 0).Select
The above would find the months column and move to one row down. But then I do not know how to make vba look through all the rows in this column which contain data and see if there is more than one month, skip the chart creation.
All the columns are dynamic and so I cannot have a defined location(as in C6 for example) from which the data can be taken. I do however have two columns, a months column(contains numbers 1-12) and year and month column(contain values jan-18 through to dec-18.... in this exact format)
I hope one of you knowledgeable folks can help.
Thank you in advance!
RastaBananaa