pk247
12-01-2014, 02:29 PM
Hi All,
I hope someone can help me with some elegant vba code please in order to do the following:
(ps I tried recording a macro but I am quite sure someone here would be able to write something way better and more reliable than my recorded macro...)
Process request:
1- Data is located in Sheet1, columns A:Z - the number of rows is unknown but should never exceed 10,000 rows (I'm thinking xldown for this?)
2- Column M will always have data in it down to the last row of the range (other rows may have the odd blank cell)
3- From Cell A2 go down to last row in range and copy all data within columns A:Z
4- Below the last row paste the same data as above
5- BUT in the newly pasted data, in column K, drag down the word located in Sheet 2 cell B2 >>> Cell B2 is variable string and that's why it needs to pull this word down through column K copied data
6- End process confirming how many rows were copied in a message box
I really hope this make sense and that someone here on this forum could help me out at all please? It's part of a bigger process but I'm trying to take all manual parts out to help save me some time.
Any help is appreciated.
Thanks!
Paul, Ireland
I hope someone can help me with some elegant vba code please in order to do the following:
(ps I tried recording a macro but I am quite sure someone here would be able to write something way better and more reliable than my recorded macro...)
Process request:
1- Data is located in Sheet1, columns A:Z - the number of rows is unknown but should never exceed 10,000 rows (I'm thinking xldown for this?)
2- Column M will always have data in it down to the last row of the range (other rows may have the odd blank cell)
3- From Cell A2 go down to last row in range and copy all data within columns A:Z
4- Below the last row paste the same data as above
5- BUT in the newly pasted data, in column K, drag down the word located in Sheet 2 cell B2 >>> Cell B2 is variable string and that's why it needs to pull this word down through column K copied data
6- End process confirming how many rows were copied in a message box
I really hope this make sense and that someone here on this forum could help me out at all please? It's part of a bigger process but I'm trying to take all manual parts out to help save me some time.
Any help is appreciated.
Thanks!
Paul, Ireland