PDA

View Full Version : [SOLVED:] Column Width



mdasifiqbal
07-08-2017, 08:47 PM
Dear Friends

I have attached an Macro enable Excel file which filters unique customer name create a new xls file and copy / paste the special cells selected. the issue is the column width in the new xls created it is not of the size of the cell copied, how do i have the cells width same as the one from where the data is copied.

Thanks and regards

Md Asif Iqbal1969619696

mana
07-08-2017, 10:03 PM
>Else
> Workbooks.Add
> ActiveWorkbook.SaveAs Pth & d & ".xlsx"



Else
Source.Copy
Workbooks.Add
ActiveSheet.PasteSpecial xlPasteColumnWidths
ActiveWorkbook.SaveAs Pth & d & ".xlsx"

mdasifiqbal
07-08-2017, 10:29 PM
Thanks a lot Mana it working but only for column A.

mana
07-08-2017, 10:34 PM
>Source.Copy

Source.resize(,12).copy

mdasifiqbal
07-08-2017, 11:39 PM
Thanks Mana its working Great.