mrnacar
Board Regular
- Joined
- Jan 27, 2010
- Messages
- 188
- Office Version
- 365
- Platform
- Windows
Can someone tell me how to fix my macro? I get the "title" error at the following code:
Here is my macro:
Code:
Selection.Find(What:=eod, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
Here is my macro:
Code:
Sub hardcode()
Dim eod As String
eod = Range("A1").Value
Dim Response As Integer
Response = MsgBox(prompt:="Selecting 'Yes' will hard code " & "'" & eod & "' values.", Buttons:=vbYesNo)
If Response = vbNo Then Exit Sub
If Response = vbYes Then
'Hard Code Portfolio Actual
Range("B11:M11").Select
Selection.Find(What:=eod, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).FormulaR1C1 = _
"=ROUND(+'\\10.10.10.205\alco\ALCO2011\Production forecast2011\[MCFCST11.xls]ACTUAL VS. FORECAST'!R8C8/1000,0)"
'Hard Code Tamuning Actual
Range("B18:M18").Select
Selection.Find(What:=eod, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).FormulaR1C1 = _
"=ROUND('\\10.10.10.205\alco\ALCO2011\Production forecast2011\[MCFCST11.xls]ACTUAL VS. FORECAST'!R6C8/1000,0)"
'Hard Code Dededo Actual
Range("B23:M23").Select
Selection.Find(What:=eod, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).FormulaR1C1 = _
"=ROUND('\\10.10.10.205\alco\ALCO2011\Production forecast2011\[MCFCST11.xls]ACTUAL VS. FORECAST'!R7C8/1000,0)"
End If
Range("B1").Select
End Sub
Thank you.