I have some idea in the coding part in excel and i was not able to get through to get the things out, could you please help me in doing this as its so urgent and i m stuck with my report generation:
I have a sheet with filtered data with the following in the columns
Column No Data in the column
1 date
2 project code
3 vehicle
4 time
5 tons
There can be chances that more columns can be added.
I need to perform the following operations with the vba coding
1.Find the total no of row with in the filtered data sheet (to make it easy take the first column- date for the referance)
Based on the total row
2.Find if the total row is less than 34 if so create one sheet with the excel sheet name taken from the column 1 (date) value of cell A2 and copy all the data of the entire rows (all the column)
3.If the row is more than 34 rows then create each new sheet with 34 rows till all the (total rows) are copied
eg: if the total rows with data is 80, create 3 sheets with sheet name format [23-01-2013 (1).xls] for the first sheet and copy rows up to 34, then copy rest 34 to another sheet name format [23-01-2013 (2).xls], and the last 12 to 3rd sheet with sheet name format [23-01-2013 (3).xls]
Note: the excel sheet is to be created by using a template excel sheet which has the reporting format
so to give an algorithm:
find total rows t=?
p=t
if p<=34
create new sheet taking the template with [date(1).xls] *date(1) is obtained from cell A2 copy the cells upto 34
else
if<=p
create new templeate sheet [date(i).xls](*date(1) is obtained from cell A2)
copy t-34 rows
i=i+1
t=t-34
loop and copy till all the rows are copied with respective of 34 rows into each new sheets representing the template format.
Can any body help me out with the coding for the excel 2013, Please?
Bookmarks