Hi everyone,
I'm trying to autofill column A in "Master Publisher Content" based on a user-specified value in "Enter Info" in cell H3. The catch is that I only want to fill column A based on the last row of data in "Master Publisher Content." I'm using column C to find the last row of data, but it doesn't seem to be working the way I would like. Any suggestions would be really appreciated!! Thank you so much in advance
Sub CopyMarketName()
'
' CopyMarketName Macro
Dim wksData As Worksheet
Dim lngLastRow As Long
Set wksData = ThisWorkbook.Worksheets("Master Publisher Content")
With wksData
lngLastRow = .Range("C" & .Rows.Count).End(xlUp).Row
Set rngData = .Range("C2:C" & lngLastRow)
End With
ThisWorkbook.Worksheets("Enter Info").Range("H2").Select.Copy
Sheets("Master Publisher Content").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range(lngLastRow), Type:=xlFillDefault
Range(lngLastRow).Select
Sheets("Enter Info").Select
End Sub
I'm trying to autofill column A in "Master Publisher Content" based on a user-specified value in "Enter Info" in cell H3. The catch is that I only want to fill column A based on the last row of data in "Master Publisher Content." I'm using column C to find the last row of data, but it doesn't seem to be working the way I would like. Any suggestions would be really appreciated!! Thank you so much in advance
Sub CopyMarketName()
'
' CopyMarketName Macro
Dim wksData As Worksheet
Dim lngLastRow As Long
Set wksData = ThisWorkbook.Worksheets("Master Publisher Content")
With wksData
lngLastRow = .Range("C" & .Rows.Count).End(xlUp).Row
Set rngData = .Range("C2:C" & lngLastRow)
End With
ThisWorkbook.Worksheets("Enter Info").Range("H2").Select.Copy
Sheets("Master Publisher Content").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range(lngLastRow), Type:=xlFillDefault
Range(lngLastRow).Select
Sheets("Enter Info").Select
End Sub