Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Go all the way along a row and then delete...



HI there,

I need Excel to go from c1 all the way to the end of the row (ie until
there is no more data in row 1), then go one more cell to the right (ie
now in a blank cell), then go down to the last bit of info in that
column, then delete from that point all along the row (ie going to the
right :), ie higher column refs ) until it runs out of data.

Thanks - appreciate some help - (Im struggling with where to put the
offsets....

Regards


D

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Go all the way along a row and then delete...

Sub DeleteData()
Dim iCol As Long
Dim iRow As Long
Dim StartRow As Long

StartRow = 10 'adjust startrow to suit
iCol = Cells(StartRow, Columns.Count).End(xlToLeft).Column
iRow = Cells(Rows.Count, iCol).End(xlUp).Row
Range(Cells(iRow, iCol), Cells(iRow, iCol).End(xlToRight)).ClearContents
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Darin Kramer" wrote in message
...


HI there,

I need Excel to go from c1 all the way to the end of the row (ie until
there is no more data in row 1), then go one more cell to the right (ie
now in a blank cell), then go down to the last bit of info in that
column, then delete from that point all along the row (ie going to the
right :), ie higher column refs ) until it runs out of data.

Thanks - appreciate some help - (Im struggling with where to put the
offsets....

Regards


D

*** Sent via Developersdex http://www.developersdex.com ***



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
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:54 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 01:06 PM.

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"