Mark usage range by vba

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Hi to everyone, i would be greatly appreciate if you could help so that to create a vba code and mark the usage range in excel. Please note that the rows are change each time whenever i download the data. Below is an example in col. "A", "B", "C" till row "8". Many thanks in advance

A B C

<colgroup><col style="mso-width-source:userset;mso-width-alt:3328;width:68pt" width="91"> <col style="mso-width-source:userset;mso-width-alt:3291;width:68pt" width="90"> <col style="mso-width-source:userset;mso-width-alt:2998;width:62pt" width="82"> </colgroup><tbody>
[TD="class: xl65, width: 91, align: center"] Daily Rate
[/TD]
[TD="class: xl66, width: 90, align: center"]Reservations
[/TD]
[TD="class: xl66, width: 82, align: center"] Sales
[/TD]

[TD="class: xl64, align: right"]102.00
[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]1938[/TD]

[TD="class: xl64, align: right"]68.00[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]1224[/TD]

[TD="class: xl64, align: right"]73.00[/TD]
[TD="align: right"]101[/TD]
[TD="align: right"]7373[/TD]

[TD="class: xl64, align: right"]77.00[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]1309[/TD]

[TD="class: xl64, align: right"]85.00[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]3825[/TD]

[TD="class: xl64, align: right"]96.00[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]1440[/TD]

[TD="class: xl64, align: right"]65.00[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]650[/TD]

</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try:
Code:
Sub SelectRange

Dim LR as Long

LR = Cells(Rows.Count, 1).End(xlUp).Row
Cells(1,1).resize(LR, 3).Select

End Sub
 
Upvote 0
Hi Jack, thank you so much for the help and your support. It works perfect and nicely! Have a great day!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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