LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Messing Up on AutoFit

This is only the Fourth Time I ever worked with Excel, so please excuse my
ignorance.

I have four columns I am creating in a new WorkBook.

Two have very long descriptions and look terrible. I come from a huge
Worksheet so I am creating a more manageable new WorkBook.

My AutoFit is not working?

Any body know what I am doing wrong. Part of my exisiting code is from the
users group already.

Here is my code.

Dim wkst As Worksheet ' Current Sheet
Dim wb As Workbook
Dim wslb As Worksheet ' Work Sheet
Dim rng As Range
Dim SelCol As String
Dim ColNum As Long

Set wkst = ActiveSheet

SelCol = InputBox("Comment Please:!")
ColNum = Columns(SelCol & ":" & SelCol).Column
SelCol = "A1," & SelCol & "1"

Set wb = Workbooks.Add(1)
Set wslb = wb.Worksheets(1)

With wkst
If .AutoFilterMode Then .AutoFilterMode = False
Set rng = .Range("A1").CurrentRegion
With rng
.AutoFilter Field:=ColNum, Criteria1:="<"
.Columns(ColNum).Copy wslb.Columns(1).Cells(1)
.Columns(2).Copy wslb.Columns(2).Cells(1)
.Columns(254).Copy wslb.Columns(3).Cells(1)
End With
End With

wslb.Range("A1:E1").Columns.AutoFit * AutoFit Not Working

Thanks to the Group

J. Q.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a new row is messing up my SUMPRODUCT Jennifer Excel Discussion (Misc queries) 3 October 16th 09 02:54 PM
Autofit (Columns.EntireColumn.AutoFit) does not work Michiel via OfficeKB.com Excel Discussion (Misc queries) 3 February 10th 09 05:29 PM
Tab character is messing me up Some Dude Excel Discussion (Misc queries) 4 June 27th 06 11:43 PM
Sort without messing up formulas Ruth Excel Discussion (Misc queries) 3 January 26th 06 02:02 PM
Rows containing "#N/A" are messing with my formulas, please help Sam Excel Worksheet Functions 1 May 17th 05 04:47 PM


All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"