1

I have the following incomplete table:

enter image description here

That I need to select the range highlighted.

I can't use the following code because the table is incomplete:

Range("C8").Select 'C8 is the first value of "Item" column, the only column that need to be fully filled
Range(Selection, Selection.End(xlDown).Offset(0, 4)).Select
Range(Selection, Selection.End(xlToLeft)).Select

So, I'm trying to select the last filled cell of "Item" column and offset it to "Custo Unitario" column. Then, I need to select till "Data" column, so I'm coding something like:

Range("C8").Select
Range(Selection, Selection.End(xlDown).Offset(0, 4)).Select
Range(Selection, Selection.Offset(0, -6)).Select`

But it isn't working. Can someone help me with this problem?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 2
    `Range("C8").End(xlDown).Offset(,-1).Resize(,6).Select`, but see [How to avoid using Select](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba). – BigBen Jan 05 '23 at 15:02

1 Answers1

0
Range(Range("C8").Offset(0, -1), Range("C8").End(xlDown).Offset(0, 4)).Select
mueda
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 05 '23 at 15:13