Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default automatic row

I need to reserve rows and columns in a spreadsheet. What I need to do id,
say:

If Row 1, Column 1 has a value, say 2, two rows are to be automatically
reserved. If the value is 1, then 1 column/row is reserved. SOS please.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default automatic row

Sub AddRows()
Dim max As Long, i As Long
Dim cnt As Long
max = 10
cnt = 0
i = 1
Do
If IsNumeric(Cells(i, 1)) And Not IsEmpty(Cells(i, 1)) Then
If Cells(i, 1).Value max Then
max = Cells(i, 1).Value + 1
End If
Cells(i, 1).Offset(1, 0).Resize(Cells(i, 1)).EntireRow.Insert
cnt = 0
Else
If IsEmpty(Cells(i, 1)) Then
cnt = cnt + 1
Else
cnt = 0
End If
End If
i = i + 1
Loop Until cnt max
End Sub

--
Regards,
Tom Ogilvy




"Ralph" wrote in message
...
I need to reserve rows and columns in a spreadsheet. What I need to do

id,
say:

If Row 1, Column 1 has a value, say 2, two rows are to be automatically
reserved. If the value is 1, then 1 column/row is reserved. SOS please.



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
automatic [email protected] uk Excel Discussion (Misc queries) 1 June 20th 09 07:19 PM
Automatic update of spreadsheet & automatic update between workboo Losva Excel Worksheet Functions 6 September 12th 08 03:22 PM
7 Day Automatic Imput Matlock Excel Discussion (Misc queries) 5 March 6th 08 02:50 AM
Automatic Value Dave Excel Discussion (Misc queries) 1 December 11th 06 09:51 PM
automatic copying KK New Users to Excel 1 September 2nd 05 03:12 PM


All times are GMT +1. The time now is 10:19 AM.

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"