VB for defined range, I think!

Stu Dapples

Active Member
Joined
Jan 12, 2009
Messages
252
I am trying to set up a sheet so when the user runs the regression, it will slelect the last 12 records in a specified column, copy them to a "graph driver" sheet and update....

I have got this far which looks like it is working right up to the point where I want to say OK, now go get the data!

<CODE>
Sub Regression_Copy()
'
' Regression_Copy Macro
Dim Start As String
Dim Finish As String


Sheets("Data").Select
Range("E1").Select
Range("E1").End(xlDown).Select
Finish = ActiveCell.Address
ActiveCell.Offset(-12, 0).Select
Start = ActiveCell.Address

Range("Start:Finish").Select
</CODE>
I know it is the range statement at teh end which I have wrong but I cant work out how to tell it use the 2 addresses within the range statement.... Hope that makes some sort of sense, many thanks in advance for your help!

Stu
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,547
Maybe something like:
Code:
Range("E1").End(xlDown).Offset(-11).Resize(12).Copy Destination:=blah blah blah
 
Last edited:

Stu Dapples

Active Member
Joined
Jan 12, 2009
Messages
252
Maybe something like:
Code:
Range("E1").End(xlDown).Offset(-11).Resize(12).Copy Destination:=blah blah blah

Looks like a good solution, will give it a whirl!!

Is there a way to use Dims in a statement like this? I am sure your method will work but it is something I am interested in....

Many thanks again ;)
 

Watch MrExcel Video

Forum statistics

Threads
1,128,205
Messages
5,629,281
Members
416,383
Latest member
Joe Reiter

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
Top