ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Start on a New Line Each Time (https://www.excelbanter.com/excel-programming/287233-macro-start-new-line-each-time.html)

Rob Miller

Macro to Start on a New Line Each Time
 
I have a spreadsheet in which I track daily prices of various stocks i
order to compose an index. Everyday I paste the prices from Yahoo int
an area on the spreadsheet. There are links (locked by "$") in anothe
worksheet, which lists the prices again with the appropriate date(as
way of recording the day's prices) . After pasting the prices, I the
"copy" the row containing the links and "Paste" it to the next row(t
prepare for the next day's prices). Then I "Paste the Values" over th
row I originally copied in order to keep a permanent record of th
day's prices. My problem is I don't know vB. I have tried to record
macro by going down to the bottom the worksheet and then hittin
"end-up arrow" but is seems the macro only records the cell I end u
in, rather than the process I go through to get there. Is there a wa
to write into the macro instructions to always go down one more row?

I hope this is clear enough. The file is attached. I paste to th
worsheet called "Paste Price" and then go through the copy and past
process on each of the other two tabs.

Thanks for your help!

Rober

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

Macro to Start on a New Line Each Time
 
Rob,

This is one way to get the next free row, assuming column B here

cLastRow = Cells(Rows.Count,"B").end(xlUp).Row+1

to access that cell, use

Cells(cLastRow,"B").Value = ....

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob Miller " wrote in message
...
I have a spreadsheet in which I track daily prices of various stocks in
order to compose an index. Everyday I paste the prices from Yahoo into
an area on the spreadsheet. There are links (locked by "$") in another
worksheet, which lists the prices again with the appropriate date(as a
way of recording the day's prices) . After pasting the prices, I then
"copy" the row containing the links and "Paste" it to the next row(to
prepare for the next day's prices). Then I "Paste the Values" over the
row I originally copied in order to keep a permanent record of the
day's prices. My problem is I don't know vB. I have tried to record a
macro by going down to the bottom the worksheet and then hitting
"end-up arrow" but is seems the macro only records the cell I end up
in, rather than the process I go through to get there. Is there a way
to write into the macro instructions to always go down one more row?

I hope this is clear enough. The file is attached. I paste to the
worsheet called "Paste Price" and then go through the copy and paste
process on each of the other two tabs.

Thanks for your help!

Robert


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com