help me chage macro

ssaifan

Active Member
Joined
Jul 29, 2003
Messages
355
pls help me change this macro....

i have this macro.......
--------------------------------------------------------
Sub STAT2()
Dim xr As Range
Dim yr As Range
Dim dr As Range
Dim last1 As Integer
Dim last2 As Integer
Dim answer
Worksheets("multiple regr.").Range("b16:g20").ClearContents
Sheets("multiple regr.").Select
last1 = 65536 - WorksheetFunction.CountBlank(Worksheets("multiple regr.").Columns("ab")) - 3
last2 = 65536 - WorksheetFunction.CountBlank(Worksheets("multiple regr.").Columns("ac")) - 3
Set yr = Range(Cells(4, 28), Cells(last1, 28))
Set xr = Range(Cells(4, 29), Cells(last2, 29))
answer = Application.WorksheetFunction.LinEst(yr, xr, , True)
Set dr = Sheets("multiple regr.").Range("b16:g20")
dr.Value = answer
End Sub
----------------------------------

now instaad of just column Ac .....i want colums AC to AG ....and data is fropm AC4 to AG .....

how do i change this macro to include this array and not the column which i had specified.....

pls help
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Watch MrExcel Video

Forum statistics

Threads
1,122,577
Messages
5,596,996
Members
414,116
Latest member
sfullnet

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