Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Range selection

Hello everybody and many thanks for the help,
I guess it is pretty straightforward if you know it but I dont.

I have a list of row and so
For i = 1 to 600
and then an If expression and after then I want a range of two cells to
be deleted
I am trying this writing but obviously not working, any suggestions?
Worksheets("ESX").Range("K" & i & ":L" & i).ClearContents

What I want is Cells columns K and L for line i to be deleted but at
the same time, not first K then L but altogether, that is why I am
using Range("K" & i & ":L" & i).
But I am not putting the " and & at the right place, can you please
help?

Thanks in advance!
DR

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Range selection

I just through an example together which works. Just change it to suit.

Sub test()

Dim i As Integer

For i = 1 To 40
If Range("A" & i).Value = 1 Then
Range("B" & i & ":C" & i).ClearContents
End If
Next i

End Sub

Hope it helps

wrote in message
oups.com...
Hello everybody and many thanks for the help,
I guess it is pretty straightforward if you know it but I dont.

I have a list of row and so
For i = 1 to 600
and then an If expression and after then I want a range of two cells to
be deleted
I am trying this writing but obviously not working, any suggestions?
Worksheets("ESX").Range("K" & i & ":L" & i).ClearContents

What I want is Cells columns K and L for line i to be deleted but at
the same time, not first K then L but altogether, that is why I am
using Range("K" & i & ":L" & i).
But I am not putting the " and & at the right place, can you please
help?

Thanks in advance!
DR



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Range selection

Thats just perfect many thanks!
Graham Whitehead a écrit :

I just through an example together which works. Just change it to suit.

Sub test()

Dim i As Integer

For i = 1 To 40
If Range("A" & i).Value = 1 Then
Range("B" & i & ":C" & i).ClearContents
End If
Next i

End Sub

Hope it helps

wrote in message
oups.com...
Hello everybody and many thanks for the help,
I guess it is pretty straightforward if you know it but I dont.

I have a list of row and so
For i = 1 to 600
and then an If expression and after then I want a range of two cells to
be deleted
I am trying this writing but obviously not working, any suggestions?
Worksheets("ESX").Range("K" & i & ":L" & i).ClearContents

What I want is Cells columns K and L for line i to be deleted but at
the same time, not first K then L but altogether, that is why I am
using Range("K" & i & ":L" & i).
But I am not putting the " and & at the right place, can you please
help?

Thanks in advance!
DR


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
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM
Range Selection Norman Jones Excel Programming 2 May 10th 04 11:18 AM
Creating range name for a range selection Mervyn Thomas Excel Programming 1 January 26th 04 05:18 PM


All times are GMT +1. The time now is 12:00 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"