Macro AutoFilling Incorrectly

Vlr516

New Member
Joined
Sep 11, 2017
Messages
22
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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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