Hi.
I am a beginner when it comes to VBA. I have tried to find the answer to my problem on several forumtreads, but it seems like I don't really understand the advance solutions.
My macro simply copies values from a Yahoo finance table in Sheet1, to Sheet2, post date and make another row.
What I want to do is someting like this, but correctly written.
Sub RunAll()
Call btnRefresh_Click
Call Sheet(2).test1 'Run-time error '438: Object doesn't support this property
Call Sheet(3).test2
End Sub
Below is a small sample of my macro.
Private Sub test1()
i = 2 'Row
j = 2 'column for numbers
Cells(i, j) = Sheets(1).Cells(2, 6)
Cells(i, j).NumberFormat = "0.00%" 'Format to %
i = 2 'Row
For j = 2 To 9 'column for numbers
Cells(i, j) = Sheets(1).Cells(6, 6) - Sheets(1).Cells(j, 6) 'Copy value from Sheet(1).Cells(6,6) minus Sheet(1).Cells(2,2:9)
Cells(i, j).NumberFormat = "0.00%" ' format to %
Next j
i = 2 'Row
j = 1 'column for numbers
Cells(i, j) = Date 'Insert todays date in cell (2,1)
Cells(2, 2).EntireRow.Insert
End Sub
I hope it wont be to much problems for you guys, but I have been trying to fix this for two days now and aint coming nowhere.
Please be very simple in your explanations, else I won't understand
Bookmarks