Hi
I have a dynamic range of data on the left (by using the randarray() function.) and I want to add VBA to a button that copy this value and paste as value to the right (as a history of random value I generated.)
I tried to google VBA but I can't get what I want. Now the problem are:
1. I cannot select range of data at the left side of my excel yet.
The origin of data is cell A5. but the number of rows and columns here is dynamic. So, I have to determine this area.
I tried to use the following code but it select only 1 row or 1 column. not the entire range of those area I want.
2. If I can determine the range of data then I can copy and paste value with the following vba.
Could somebody suggest me what I should do please?
Thank you
I have a dynamic range of data on the left (by using the randarray() function.) and I want to add VBA to a button that copy this value and paste as value to the right (as a history of random value I generated.)
I tried to google VBA but I can't get what I want. Now the problem are:
1. I cannot select range of data at the left side of my excel yet.
The origin of data is cell A5. but the number of rows and columns here is dynamic. So, I have to determine this area.
I tried to use the following code but it select only 1 row or 1 column. not the entire range of those area I want.
VBA Code:
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Range(ActiveCell, ActiveCell.End(xlToRight)).Select
2. If I can determine the range of data then I can copy and paste value with the following vba.
Code:
Range.Copy
'Range("J5").PasteSpecial (xlPasteValues)
Could somebody suggest me what I should do please?
Thank you