M
MT_Netols
I have a somewhat lengthy question that I'm hoping someone can help m
with. I can't get a macro I'm trying to write to operate correctly, s
maybe someone knows a code that will help.
Here's the situation:
- I have four sheets (Sheet 1, 2, 3, & 4 for simplicity's sake), Sheet
1-3 contain stocks I'm looking at at various points of my analysi
stage. Sheet 4 contains a list of all the stocks from Sheets 1-3.
- I import the stock quotes on Sheet 4 so I can obtain the most curren
prices for my stocks.
- Now, what I want to do is have my macro run through the list o
stock tickers on Sheet 4, and if it finds the corresponding ticker i
Sheet 1, I want it to copy in the new current price.
- For example: Stock XYZ is on Sheet 1, with the ticker in column
and the current price in column D. The ticker is also on Sheet 4 wit
the new current price in column E, so what I want to do is somethin
along the lines of:
For each A:A in Sheet4! If A = Sheet1! A:A Then
copy Sheet4! E:E into Sheet1! D
I hope what I'm trying to accomplish makes sense, I basically just wan
to update what I have typed in for the current prices without having t
manually type them all in, so if I can have the macro run through th
list in Sheet4, look for it in Sheet1, and if it finds it, copy th
price in. I know that if I can get just one run of this to work I ca
change the Sheet references to have it run for Sheets 1, 2, and 3, s
any help would be greatly appreciated
with. I can't get a macro I'm trying to write to operate correctly, s
maybe someone knows a code that will help.
Here's the situation:
- I have four sheets (Sheet 1, 2, 3, & 4 for simplicity's sake), Sheet
1-3 contain stocks I'm looking at at various points of my analysi
stage. Sheet 4 contains a list of all the stocks from Sheets 1-3.
- I import the stock quotes on Sheet 4 so I can obtain the most curren
prices for my stocks.
- Now, what I want to do is have my macro run through the list o
stock tickers on Sheet 4, and if it finds the corresponding ticker i
Sheet 1, I want it to copy in the new current price.
- For example: Stock XYZ is on Sheet 1, with the ticker in column
and the current price in column D. The ticker is also on Sheet 4 wit
the new current price in column E, so what I want to do is somethin
along the lines of:
For each A:A in Sheet4! If A = Sheet1! A:A Then
copy Sheet4! E:E into Sheet1! D
I hope what I'm trying to accomplish makes sense, I basically just wan
to update what I have typed in for the current prices without having t
manually type them all in, so if I can have the macro run through th
list in Sheet4, look for it in Sheet1, and if it finds it, copy th
price in. I know that if I can get just one run of this to work I ca
change the Sheet references to have it run for Sheets 1, 2, and 3, s
any help would be greatly appreciated