Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Goto end of data & select all rows below

Hi,

could somebody help me some code?

I can go to the last cell but i am not sure how to select all rows
below, as i have to delete them.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Goto end of data & select all rows below

Dim rng as Range
set rng = Cells(1,1).End(xlup)(2)
Range(rng,Range("A65536")).EntireRow.delete

--
Regards,
Tom Ogilvy

"Tempy" wrote in message
...
Hi,

could somebody help me some code?

I can go to the last cell but i am not sure how to select all rows
below, as i have to delete them.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Goto end of data & select all rows below

Hello Tom,
I think i did not make myself clear enough.

The data varies in amount of rows, so i cannot set the range to a
specific range.
Each time the code runs, it has to test to get the range and then delete
everyting below the data.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Goto end of data & select all rows below

Hello Tom,
I think i did not make myself clear enough.

The data varies in amount of rows, so i cannot set the range to a
specific range.
Each time the code runs, it has to test to get the range and then delete
everyting below the data.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Goto end of data & select all rows below

sorry - typo

Dim rng as Range
set rng = Cells(rows.count,1).End(xlup)(2)
Range(rng,Range("A65536")).EntireRow.delete

This finds the last filled cell in column A.

If you already have a way to find the row to start deleting, then just use
that and set the result to the range variable rng. then use

Range(rng,Range("A65536")).Entirerow.Delete

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hello Tom,
I think i did not make myself clear enough.

The data varies in amount of rows, so i cannot set the range to a
specific range.
Each time the code runs, it has to test to get the range and then delete
everyting below the data.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Goto end of data & select all rows below

Thank you Tom.

You guys really do a great job.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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 select and copy rows only containing data shaz0503 Excel Discussion (Misc queries) 5 October 10th 08 01:58 AM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
Select certain data rows lee's news New Users to Excel 2 December 19th 06 09:19 PM
Select Rows dependant on certain field data Maddy New Users to Excel 1 July 27th 05 03:50 PM
Select all data, multiple rows George Wilson Excel Discussion (Misc queries) 6 December 5th 04 08:16 PM


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