Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting Rows from using a target cell


Hi

I posted a similar question before but I was wondering if
anybody has further ideas on this.....

It is possible to control the number of rows contained in
a range by entering numerical values in a target cell on a
spreadsheet.

If my range consisted of A2: F30, firstly how would I tell
excel that this is my range and secondly get it to add
and/or delete lines based on the number entered in the
target cell by the user.

The problem I have is that the first column of the range
consists of dates, which in turn are linked to formula. So
if somebody enters say no. "6" in the month cell "A1"I
want the macro to automatically delete a certain number of
lines in the range, and then reformat the entire range by
copying down above formula to end of new range.

This is probably a tall order I'm sure, but any guidance
is much appreciated.

Regards,

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting Rows from using a target cell

Sounds like you want a month's worth of dates in column A and you are
worried about 28, 29, 30, or 31 days in the month.

You could just build conditional formulas and eliminate using code.


in A2

=IF(MONTH(DATE(YEAR(TODAY()),$A$1,ROW()-1))<$A$1,"",DATE(YEAR(TODAY()),$A$1
,ROW()-1))

then drag fill down to row 32.

You other formulas in the row can key off this column

=if($A2="","",formula)

Regards,
Tom Ogilvy





"Mike" wrote in message
...

Hi

I posted a similar question before but I was wondering if
anybody has further ideas on this.....

It is possible to control the number of rows contained in
a range by entering numerical values in a target cell on a
spreadsheet.

If my range consisted of A2: F30, firstly how would I tell
excel that this is my range and secondly get it to add
and/or delete lines based on the number entered in the
target cell by the user.

The problem I have is that the first column of the range
consists of dates, which in turn are linked to formula. So
if somebody enters say no. "6" in the month cell "A1"I
want the macro to automatically delete a certain number of
lines in the range, and then reformat the entire range by
copying down above formula to end of new range.

This is probably a tall order I'm sure, but any guidance
is much appreciated.

Regards,

Mike



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
deleting cells that are controlled using Target code NDBC Excel Discussion (Misc queries) 2 July 24th 09 12:26 AM
Target cell reference moves when target is cut and pasted Illya Teideman Excel Discussion (Misc queries) 5 May 31st 07 11:34 AM
retain hyperlink target when adding/deleting rows AGK New Users to Excel 3 May 23rd 06 01:59 AM
deleting entire rows with the same cell value in the first column Pedro F. Excel Discussion (Misc queries) 3 January 11th 06 07:10 PM
Deleting rows based on a cell value JPriest Excel Worksheet Functions 3 August 12th 05 05:44 PM


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