Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I select a range of cells without doing Range("a3", "f3")..

Hi, does anyone know how to select a range of cells without using exact
references?

Basically what I want to do is

If a20 = blank or zero, I want to delete cells in that row from a to f
(then I will test the next cell)

(Selection.Delete Shift:=xlUp)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default How do I select a range of cells without doing Range("a3", "f3")..

Miriam

something like:

Range(Activecell,Activecell.Offset(0,5)).Select

You might want to check that the Active cell is in Column A

You don't need to select the cells though:

Range(Activecell,Activecell.Offset(0,5)).Delete Shift:=xlUp

Regards

Trevor


"Miriam" wrote in message
...
Hi, does anyone know how to select a range of cells without using exact
references?

Basically what I want to do is

If a20 = blank or zero, I want to delete cells in that row from a to f
(then I will test the next cell)

(Selection.Delete Shift:=xlUp)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How do I select a range of cells without doing Range("a3", "f3")..


Do
If Range("A20").Value = 0 Or Range("A20").Value = "" Then
Range("A20:F20").Delete Shift:=xlUp
End If
Loop Until Range("A20").Value < 0 And Range("A20").Value < ""

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Miriam" wrote in message
...
Hi, does anyone know how to select a range of cells without using exact
references?

Basically what I want to do is

If a20 = blank or zero, I want to delete cells in that row from a to f
(then I will test the next cell)

(Selection.Delete Shift:=xlUp)



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
Using "=randbetween" to select a number from a range of cells a0xbjzz Excel Worksheet Functions 4 August 4th 07 07:47 PM
Multiple "Range" with "Cells" property? jopu[_2_] Excel Programming 3 November 18th 04 04:05 PM
Multiple "Range" with "Cells" property? jopu Excel Programming 2 November 18th 04 02:38 PM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM


All times are GMT +1. The time now is 06:26 AM.

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

About Us

"It's about Microsoft Excel"