Here is a code that I requested to look for an input and compare to a column. It looks like it is working except the output is coping over all TestRange3 and not just ones that match the header. I have several different numbers in TestRange 2 and I need this to be able to go through the column and just pull out what I have requested. All help would be greatly appreciated.
Dim cellstart As Integer 'starting point of informaiton (row)
Dim p As Integer
Dim n As String 'counting variable
Dim TestRange As String 'Test String
Dim TestRange2 As String 'Test String
Dim TestRange3 As String 'Test String
Dim Output(1 To 10) As String
Dim m As String
Dim sh As String
Dim destsh As String
Dim reportlocation As String
Dim header As String 'header you want to run Holds header
cellstart = 3 'Starting point of source sheet
p = 0
header = InputBox("Which header do you want to run?", "header") 'input the requested header
sh = "Daily" 'Work sheet where the header information is kept
destsh = header ' desination sheet for header
n = cellstart
TestRange2 = "B" + n 'column where to match header request
TestRange3 = "A" + n
Do While header <> Sheets(sh).Range(TestRange2)
p = p + 1
m = p + 4 'Tells where to start importing information on dest sheet
reportlocation = "A" + m 'starting point of output file
Sheets(sh).Range(TestRange3).Copy Sheets(destsh).Range(reportlocation)
TestRange2 = "B" + n
TestRange3 = "A" + n
n = n + 1
Loop
End Sub
Dim cellstart As Integer 'starting point of informaiton (row)
Dim p As Integer
Dim n As String 'counting variable
Dim TestRange As String 'Test String
Dim TestRange2 As String 'Test String
Dim TestRange3 As String 'Test String
Dim Output(1 To 10) As String
Dim m As String
Dim sh As String
Dim destsh As String
Dim reportlocation As String
Dim header As String 'header you want to run Holds header
cellstart = 3 'Starting point of source sheet
p = 0
header = InputBox("Which header do you want to run?", "header") 'input the requested header
sh = "Daily" 'Work sheet where the header information is kept
destsh = header ' desination sheet for header
n = cellstart
TestRange2 = "B" + n 'column where to match header request
TestRange3 = "A" + n
Do While header <> Sheets(sh).Range(TestRange2)
p = p + 1
m = p + 4 'Tells where to start importing information on dest sheet
reportlocation = "A" + m 'starting point of output file
Sheets(sh).Range(TestRange3).Copy Sheets(destsh).Range(reportlocation)
TestRange2 = "B" + n
TestRange3 = "A" + n
n = n + 1
Loop
End Sub