VB Code Question

S

Stan

Can anyone tell me what I need to add to the code below to move the range up
1 row?

LastRowInB = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("A1:C" & FoundCell.Row).Select


Many thanks!
 
P

PCLIVE

You may need to post more of your code. But on first glance, it appears you
have periods in various places that I don't understand. I was assuming
everything was working with the exception of selecting one row up. Try
this:

LastRowInB = Cells(Rows.Count, "B").End(xlUp).Row
Range("A1:C" & FoundCell.Row.Offset(-1, 0)).Select

HTH,
Paul
 
D

Dave Peterson

.Range("A1:C" & FoundCell.Row - 1).Select

or maybe

.Range("A1:C" & lastrowinB - 1).Select
 
D

Don Guillett

try this. You may want row-1. Why are you selecting?

LastRowInB = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("A1:C" & lastrowinb).Select
 
Top