What is The ORng value after this code is run?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is part of a shopping cart like application I am running. For some
reason, when items are added to the cart now, they go to the wrong place on
the sheet, I think this is the satetment I need to correct, but I don't have
enough understanding of it to make the corrections.

Dim Inrng As Range
Dim ORng As Range
Dim inWs As Worksheet
Dim outWs As Worksheet
Dim iLastRow As Long

Set inWs = ActiveSheet
Set outWs = Worksheets("Order Form")
Set ORng = outWs.Cells(outWs.Cells(Rows.Count, 1).End(xlUp).Row + 1, "A")


TIA
 
ORng is a range object pointing to the blank cell just below the data in
column A
Add this line of code to see what I mean...

Dim Inrng As Range
Dim ORng As Range
Dim inWs As Worksheet
Dim outWs As Worksheet
Dim iLastRow As Long

Set inWs = ActiveSheet
Set outWs = Worksheets("Order Form")
Set ORng = outWs.Cells(outWs.Cells(Rows.Count, 1).End(xlUp).Row + 1, "A")
msgbox ORng.address '***This new line will display the address
 
Back
Top