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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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