decadence
Well-known Member
- Joined
- Oct 9, 2015
- Messages
- 525
- Office Version
- 365
- 2016
- 2013
- 2010
- 2007
- Platform
- Windows
Hi, I am trying to set my range so that the header is not included How do I do this.
This is what I need to change to start from the next cell below the Header found.
This is what I need to change to start from the next cell below the Header found.
Code:
Set Rng = Rng.Resize(Cells(Rows.Count, Rng.Column).End(xlUp).row)
Code:
Dim xTitleId As Variant, Rng As Range, x As Range, i As Range, addStr As String
Application.ScreenUpdating = False
For Each i In Range("A1:Z2")
Select Case i.value2
Case "IPN", "Part", "Part Number"
If Not Rng Is Nothing Then
Set Rng = Union(Rng, i)
Else
Set Rng = i
End If
End Select
Next
If Rng Is Nothing Then Exit Sub
If Not Rng Is Nothing Then
Set Rng = Rng.Resize(Cells(Rows.Count, Rng.Column).End(xlUp).row)
With Rng
.AutoFilter Field:=1, Criteria1:="<>*Nothing*", Operator:=xlAnd, Criteria2:="<>*Something*"
.SpecialCells (xlCellTypeVisible)
addStr = Application.InputBox("Add Prefix", xTitleId, "", Type:=2)
On Error Resume Next
For Each x In Rng
x.Value = addStr & x.Value
Next x
End With
Selection.AutoFilter
Application.ScreenUpdating = True
End If
End Sub