Hi,
Pure Brilliance on your part !(And silly me for not having observed it !)
I did successfully modify the code as follows
You will see that i made the range start from A2 because i noted that in each of my sheet the first row was blank and also i do ActiveSheet.Cells(2, 2).Copy because the sheet which i wanted to copy was also had first row blank ,so i copied the 2nd cell starting from row 2 .......
Things worked like a dream ,
(Prior to this ,let me be honest ,i tried rows ("1":"1").delete,but that didnt work and gave me pastespecial method failed )
Phase -2 (Deleting blank rows and columns for unused range
Then i decided that i will delete the blank rows and columns for unused ranges ,
I noted that you have already computed last row in the code
So i stored last used row +1 also in another variable X ,
Also ,I computed total number of rows first using rows.count property-> in a variable y ,
Then for deleting unused range (blank rows) ,exactly i needed to delete this range from->used rows +1 to total rows .....
Range("x:y").Delete
Same things for blank columns ,i.e
i saw that you had already computed last used column in code and stored it in variable LC
So i stored last used column + 1 in variable a (For going to one column more than the used column ...in this used column was 5 so this resulted in first unused column starting from 6 )
Also i basically figured out the total column count in a variable b using columns.count property
Then for deleting unused range (blank columns) ,exactly i needed to delete this range from used column +1 to total columns left .....
Range("a:b").Delete .....
I ,only in this part got a paste special error and the sheets get cut when i try this part ..i am playing around and think i will get it shortly ,once i do i will definitedly post
the solution ,
I really thank you ,using your code i can now understand VB more better than i earlier did ,also it made my practical work of having same formatting across 745 sheets a breeze !
Using some minor modification ,i think i can delete the unused rows and columns shortly ,
Thank you so so much
Regards ,
Amlan Dutta
Bookmarks