VBA Help with Range

decadence

Well-known Member
Joined
Oct 9, 2015
Messages
525
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2010
  5. 2007
Platform
  1. 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.

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
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hallo,

considering the tite, not the code and untested:

Code:
Set Rng = Rng.Resize(Cells(Rows.Count, Rng.Column).End(xlUp).row).offset(1)

regards
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top