Select cells between the active cell and another column on same row

CreativeUsername

Board Regular
Joined
Mar 11, 2017
Messages
52
I'm not finding what I need.

I have the following code.

Code:
  Range("E1").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Select
    ActiveCell.FormulaR1C1 = "xxxxxx"
    Selection.AutoFill Destination:=Range("E58:AC58"), Type:=xlFillDefault
[CODE]

What I need to happen is fill the range of cells between the active cell in E and column AC on the same row as E with some "X" values. 

So Range("E58:AC58") is over specified.  If the data set is only 55 Items long then it fails.  I recorded this as a macro but am having trouble with the syntax to convert it to relative cells.

thanks,



That actually is only there to block excel from running a calculation and conditional format into infinity because I use the XL down later.  In small tests it wasn't recognizing the end of the data range unless I gave it that stop.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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
Back
Top