I have here my code in VB6 and its working well.
For CLms = 1 To 10
ws.Columns(CLms).AutoFit '<---Autofilt data on XL sheet
Next CLms
I have searched on what is the equivalent or alternative on how to make the excel columns width autofit in VB.NET, but I'm still not getting the exact AutoFit function.
Any help will be appreciated.
This is how I've done it in vb.net.
xlSheet.Range("A1:X1").EntireColumn.AutoFit()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With