Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
K K is offline
external usenet poster
 
Posts: 108
Default Formula help?

Good day.

How do I take a cell (I15)'s result for example say it is 10 and have column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to 20?
is this possible?

Kyle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Formula help?

On Sep 5, 11:53*pm, K wrote:
Good day.

How do I take a cell (I15)'s result for example say it is 10 and have column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to 20?
is this possible?

Kyle


One way...

=IF($I$15-ROW(1:1)=0,ROW(1:1),"")

filled down as far as needed.

Ken Johnson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Formula help?

in each cell in A

=IF(ROW()$I$15,"",ROW())



"K" wrote:

Good day.

How do I take a cell (I15)'s result for example say it is 10 and have column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to 20?
is this possible?

Kyle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Formula help?

A bit of a novel way to do it. Right click sheet tabview code copy/paste
this.
Be advised that this will fire with any and all calculations.

Private Sub Worksheet_Calculate()
Columns(1).ClearContents
Application.EnableEvents = False
Range("a1:a" & Range("b1")).Formula = "=Row(a1)"
Columns(1).Value = Columns(1).Value
Application.EnableEvents = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"K" wrote in message
...
Good day.

How do I take a cell (I15)'s result for example say it is 10 and have
column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to
20?
is this possible?

Kyle


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Formula help?

This is a little more dynamic.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim x As Long
If Target.Address = "$I$1" Then
Range("A1:A65536").Value = ""
For x = 1 To Target.Value
Range(Cells(x, 1).Address).Value = x
Next x
End If
End Sub

"K" wrote:

Good day.

How do I take a cell (I15)'s result for example say it is 10 and have column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to 20?
is this possible?

Kyle



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Formula help?

Replace:
Range("A1:A65536").Value = ""

With:
Columns(1).ClearContents

"Kent Prokopy" wrote:

This is a little more dynamic.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim x As Long
If Target.Address = "$I$1" Then
Range("A1:A65536").Value = ""
For x = 1 To Target.Value
Range(Cells(x, 1).Address).Value = x
Next x
End If
End Sub

"K" wrote:

Good day.

How do I take a cell (I15)'s result for example say it is 10 and have column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to 20?
is this possible?

Kyle

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Formula help?

This Change event code for the worksheet you want to have this functionality
will automatically change the numbering in Column A whenever the number in
I15 is changed...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Long
If Target.Address = "$I$15" Then
Columns("A").Clear
For X = 1 To Target.Value
Cells(X, "A") = X
Next
End If
End Sub

--
Rick (MVP - Excel)


"K" wrote in message
...
Good day.

How do I take a cell (I15)'s result for example say it is 10 and have
column
A put 1 to 10 from A1 - A10 or in the respected fields? And if the result
changes to 20 say it fills in the cells from A1 - A20 with 1,2,3, etc. to
20?
is this possible?

Kyle


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
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 01:49 PM.

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"