View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Selecting the correct range

This line is wrong
Worksheets("SS A").Range("A:IV").ClearContents
should be
Worksheets("SS A").Range("A:AN").ClearContents


"Trever B" wrote:

Hi,

Thanks in advance

In the following code it is supposed to select Colums A to AN and copy them
to another worksheet (SS A). The problem is it only does A to V. (Could
have something to do with blank rows/Columns?)

How do I change the Current region to include A to AN

Application.EnableEvents = False


Worksheets("SS A").Range("A:IV").ClearContents



'With Worksheets("Panel Details").Range("A1").CurrentRegion
.AutoFilter Field:=1, Criteria1:="A"
.SpecialCells(xlCellTypeVisible).Copy _
Worksheets("SS A").Cells(1, 1)
.AutoFilter
End With


Application.EnableEvents = True