blcexcel
Member
This is a followup question to an earlier post. I decided I need to have the output on a separate tab. I have the data on "MerchList" tab and I data on "Output" tab. I tried adding two Sheets statements but I get an error after: Sheets("Output").Select
Thanks in advance!
[pre]
[/pre]
Thanks in advance!
[pre]
Code:
'Start Merch List
Sheets("MerchList").Select
Dim merchName As String
Dim startRow As Long
Dim endRow As Long
Dim rCount As Long
Dim x As Long
'Set intial record count
rCount = 1
'Now, we setup a loop to go through all the Merch_List
For x = 2 To Range("A6").End(xlDown).Row
'Get necessary input info
merchName = Cells(x, "A").Value
startRow = Cells(x, "B").Value
endRow = Cells(x, "C").Value
'Now we can do our output
Sheets("Output").Select
Range(Cells(startRow, "B"), Cells(endRow, "B")).Value = merchName
'increment rcount
rCount = rCount + 1
'and we're ready for the next input line
Next x