rutgerterhaar

New Member
Joined
Jan 21, 2012
Messages
18
Hi there,

I've got a short question: I have two variable ranges:
One in row 4, starting in column F
One in Column E, starting in row 5

I want to set a range for a macro for these two variable ranges. So one is Range("F4:.....") and the other one is Range("E5,....). I have to find the Last filled column for the first one and the last filled column for the second one. I know how to do that, but how do I get this in the range??

This is probably a simple question, but I couldn't find it on the forum.

I hope the question is clear to you guys!

Thanks!!!!!

Rutger
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try:

Code:
Sub Test()
    Dim Rng As Range
    With ActiveSheet
        Set Rng = .Range(.Range("F4"), .Cells(4, .Columns.Count).End(xlToLeft))
        MsgBox Rng.Address
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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