In my template macro, I am getting incorrect information pulled on my autofill and I am not sure why. Your assistance would be greatly appreciated.
One my source spreadsheet which I start on when I begin the macro, I have a header row on line 5 then data starts on line 6 and goes to line 15 but the final row could change depending on the workbook. Column A is an IDNo and Column C is a TitleName. These two concatenate together in my template sheet in Column C beginning on line 6. When I run the macro, they do concatenate but the IDNo is only using the data from line 6 while TitleName runs properly through each row.
Therefore my results look like:
ID1--Name1
ID1--Name2
and so forth when it should look like:
ID1--Name1
ID2--Name2
Here is what I have in coding:
Sub
Set sourcespreadsheet = ActiveSheet
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
IDNo = sourcespreadsheet.Range("A6")
TitleName = sourcespreadsheet.Range("C6")
set Templatesheet = Activesheet
Range("C6").Formula = IDNo & "--" & TitleName
Range("C6").AutoFill Destination:=Range(C6:C" & FinalRow), Type:=xlFillDefault
End Sub
One my source spreadsheet which I start on when I begin the macro, I have a header row on line 5 then data starts on line 6 and goes to line 15 but the final row could change depending on the workbook. Column A is an IDNo and Column C is a TitleName. These two concatenate together in my template sheet in Column C beginning on line 6. When I run the macro, they do concatenate but the IDNo is only using the data from line 6 while TitleName runs properly through each row.
Therefore my results look like:
ID1--Name1
ID1--Name2
and so forth when it should look like:
ID1--Name1
ID2--Name2
Here is what I have in coding:
Sub
Set sourcespreadsheet = ActiveSheet
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
IDNo = sourcespreadsheet.Range("A6")
TitleName = sourcespreadsheet.Range("C6")
set Templatesheet = Activesheet
Range("C6").Formula = IDNo & "--" & TitleName
Range("C6").AutoFill Destination:=Range(C6:C" & FinalRow), Type:=xlFillDefault
End Sub