Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AUTO FORMATTING WHEN ADDING ADDITIONAL ROWS

I have a spreadsheet which is a user list for new job costings
When additional rows are added i need to update the range to include
the new additional rows
Is there an automatic procedure or code to automatically the code as
below?

Range("A2:G407").Select

When a new code is added (in the spreadsheet ) the range will go from
a2:g407 to a2:g410

Thankyou
Darrell

With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Range("A1").Select
Rows("1:1").RowHeight = 23.25
Range("A1").Select
ActiveCell.FormulaR1C1 = "CODE"
Range("B1").Select
ActiveCell.FormulaR1C1 = "NAME"
Range("C1").Select
ActiveCell.FormulaR1C1 = "BANK #"
Range("D1").Select
ActiveCell.FormulaR1C1 = "REC/GRP"
Range("E1").Select
ActiveCell.FormulaR1C1 = "D/MDLE"
Range("F1").Select
ActiveCell.FormulaR1C1 = "JOB #"
Range("G1").Select
ActiveCell.FormulaR1C1 = "GST CODE"
Range("A2:G407").Select
Selection.RowHeight = 20
Range("A2").Select
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default AUTO FORMATTING WHEN ADDING ADDITIONAL ROWS


Dear Sir,

Thry the following:

Range("a2").Resize(Selection.End(xlDown), 7).Select

What it does?

1. Select cell "A2" -- your first cell in the range
2. Expand the range to include the new rows added
"resize(selection.end(xldown),7).
3. Select the new range --" a2:g407"

Please, let me know if that solved your problem.

regards
Juan Carlos


--
cscorp
------------------------------------------------------------------------
cscorp's Profile: http://www.excelforum.com/member.php...o&userid=24015
View this thread: http://www.excelforum.com/showthread...hreadid=376978

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default AUTO FORMATTING WHEN ADDING ADDITIONAL ROWS

Unfortunately that isn't what you function does. It would use the value in
the last cell entered to determine the extent of the selection - if the
value was a 1 it would select A2:G2. If the value was not numeric, it would
raise an error. I think you meant:

Range("a2").Resize(Selection.End(xlDown).row - 1, 7).Select

--
Regards,
Tom Ogilvy


"cscorp" wrote in
message ...

Dear Sir,

Thry the following:

Range("a2").Resize(Selection.End(xlDown), 7).Select

What it does?

1. Select cell "A2" -- your first cell in the range
2. Expand the range to include the new rows added
"resize(selection.end(xldown),7).
3. Select the new range --" a2:g407"

Please, let me know if that solved your problem.

regards
Juan Carlos


--
cscorp
------------------------------------------------------------------------
cscorp's Profile:

http://www.excelforum.com/member.php...o&userid=24015
View this thread: http://www.excelforum.com/showthread...hreadid=376978



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
Automatically adding additional rows Volntyr Excel Discussion (Misc queries) 2 December 5th 09 11:39 AM
Auto extract data & inserts rows additional rows automatically Meeru Excel Discussion (Misc queries) 3 September 9th 09 01:46 PM
Please help with Sumproduct, adding additional criteria Gina[_2_] Excel Worksheet Functions 5 October 1st 08 02:23 PM
How can I keep conditional formatting when adding rows to excel? Excel one tenth guru Excel Discussion (Misc queries) 0 January 10th 07 02:57 PM
Adding additional rows in VBA based on character strings Mike Excel Programming 1 February 8th 05 06:22 PM


All times are GMT +1. The time now is 09:52 AM.

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

About Us

"It's about Microsoft Excel"