Trouble with Setting Formula of a Cell on the non active sheet

fchurchill

New Member
Joined
Dec 30, 2015
Messages
2
I am having trouble setting the formula of a cell on the non-active sheet. I have tried making the sheet.cell active and then setting the activecell.formula parameter with no luck. The place where my code is hanging up is bold.


Sub MoveFinVIZ()


Dim nRow As Integer
Dim oRow As Integer
Dim columnsearch As Integer
Dim ticker As String
Dim hyper As String

nRow = 2

'find open column on FINVIZ sheet
For columnsearch = 1 To 100

If Sheets("FINVIZ").Cells(1, columnsearch) = "" Then

Exit For
End If

Next columnsearch

'insert date
Sheets("FINVIZ").Cells(1, columnsearch).Value = Date
Sheets("FINVIZ").Cells(1, columnsearch).NumberFormat = "mm/dd/yy"


'Loop through the contents on alltimehigh sheet one Row at a time
For oRow = 18 To 100

'Get the ticker and store it as a variable.
ticker = Sheets("DAILY").Cells(oRow, 14)

If ticker <> "" Then

'Set the ticker in FINVIZ
'Sheets("FINVIZ").Cells(nRow, columnsearch) = ticker
hyper = "http://finance.yahoo.com/echarts?s=" & ticker
Sheets("FINVIZ").Cells(nRow, columnsearch).Select
ActiveCell.FormulaR1C1 = "=HYPERLINK(""" & hyper & """,""" & ticker & """)"

nRow = nRow + 1
End If

Next oRow

End Sub
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Finally got it.

hyper = "http://finance.yahoo.com/echarts?s=" & ticker & "+Interactive#{" & Chr(34) & "showArea" & Chr(34) & ":false," & Chr(34) & "showLine" & Chr(34) & ":false," & Chr(34) & "showCandle" & Chr(34) & ":true," & Chr(34) & "lineType" & Chr(34) & ":" & Chr(34) & "candle" & Chr(34) & "," & Chr(34) & "range" & Chr(34) & ":" & Chr(34) & "max" & Chr(34) & "," & Chr(34) & "allowChartStacking" & Chr(34) & ":true}"
Sheets("FINVIZ").Cells(nRow, columnsearch) = hyper



With Worksheets("FINVIZ")
.Hyperlinks.Add Anchor:=.Cells(nRow, columnsearch), _
Address:=hyper, _
TextToDisplay:=ticker
End With
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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