#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 150
Default VB Code Question

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default VB Code Question

Maybe this:

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

Regards,
Paul

"Stan" wrote in message
...
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!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 150
Default VB Code Question

Regretfully that gives me an invalid qualifier error.

"PCLIVE" wrote:

Maybe this:

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

Regards,
Paul

"Stan" wrote in message
...
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!




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default VB Code Question

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



"Stan" wrote in message
...
Regretfully that gives me an invalid qualifier error.

"PCLIVE" wrote:

Maybe this:

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

Regards,
Paul

"Stan" wrote in message
...
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!






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VB Code Question

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

or maybe

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



Stan wrote:

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!


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default VB Code Question

Sorry about that. Had a brain fart. Go with Dave Peterson's suggestion.


"PCLIVE" wrote in message
...
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



"Stan" wrote in message
...
Regretfully that gives me an invalid qualifier error.

"PCLIVE" wrote:

Maybe this:

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

Regards,
Paul

"Stan" wrote in message
...
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!







  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default VB Code Question

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

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


--
Don Guillett
SalesAid Software

"Stan" wrote in message
...
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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM
Code question for clearing a command checkbox. Newbeetle Excel Discussion (Misc queries) 4 February 13th 07 09:05 AM
question about excessive code in replacing #N/A when using VLOOKUP njuneardave Excel Discussion (Misc queries) 4 June 21st 06 03:14 AM
Easy VB code question Anthony Excel Discussion (Misc queries) 2 July 8th 05 08:45 PM
syntax question - cell references in VB code needyourhelp New Users to Excel 1 March 2nd 05 08:52 PM


All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"