I need some help modifying the following macro

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
I need some help modifying the following macro.

Code:
Sub YHOO_Buy()
Dim Id As Long

req = "buy_1000_YHOO'"

Id = Round((Date - 39000 + Time) * 1000000, 0)


ActiveCell.Value = "=dem|ord!'id" & Id & "?place?" & req

End Sub

I want to change the ActiveCell to a specific address, in this case A1. In what way do I need to modify the above macro?

Regards,
suprsnipes
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Instead of ActiveCell use Range("A1").

Although to be honest it's always better to reference these things explicitly, that is to say, don't assume that the correct workbook and worksheet are always the active ones otherwise you might be writing to the wrong place.

So perhaps ThisWorkbook.Sheets("Sheet1").Range("A1") might be better. (Modify the sheet name to suit.)
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

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