set worksheet in range

ummjay

Board Regular
Joined
Oct 1, 2010
Messages
193
hey guys,
how can i set an entire worksheet into a range?

I tried this, but it's not working:

Code:
For i = 3 To Worksheets.Count
Set wksTemp = Worksheets(i)
With wksTemp
setMSG2 = wksTemp.UsedRange
.HTMLBody = strMSG & strMSG2

maybe i need to set setMSG2 as something else? Or maybe it's the way i'm trying to display on .HTMLBody? I'm not getting an erorr, its just not showing anything. Everything else in my code works fine, this is just a piece.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
i also tried:

Code:
For i = 3 To Worksheets.Count
        Set wksTemp = Worksheets(i)
        With wksTemp
        
        Set rng = .Range("B2")
        strMSG = Sheets("RUN").Range("B8").Value
        strSUBJ = Sheets("RUN").Range("B6").Value
        'page range
        lr = Cells(Rows.Count, "B").End(xlUp).Row
        lc = Cells(1, Columns.Count).End(xlToLeft).Column
        strMSG2 = Range("A1").Resize(lr, lc)

it's not liking my lr or lc. any ideas?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,276
Members
449,075
Latest member
staticfluids

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