What is The ORng value after this code is run?

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top