Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically adding additional rows | Excel Discussion (Misc queries) | |||
Auto extract data & inserts rows additional rows automatically | Excel Discussion (Misc queries) | |||
Please help with Sumproduct, adding additional criteria | Excel Worksheet Functions | |||
How can I keep conditional formatting when adding rows to excel? | Excel Discussion (Misc queries) | |||
Adding additional rows in VBA based on character strings | Excel Programming |