Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Updatig the Next Consecutive Empty Cell in a Range

I am tracking a bank account balance and would like that whenever a new value
is entered in cell c3, it updates the next consecutive empty cell in range
c5:c200. Please advise how I can write the formula, function or macro.

Thanks Sony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Updatig the Next Consecutive Empty Cell in a Range

You need event code to do what you want. Try this... right click the tab at
the bottom of the worksheet where you want this functionality, select "View
Code" from the popup menu that appears and copy/paste the following into the
code window that appears...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long
If Target.Address(0, 0) = "C3" Then
LastRow = Range("C200").End(xlUp).Row
If LastRow = 5 Then Exit Sub
If LastRow = 3 Then LastRow = 5
If LastRow < 200 Then Cells(LastRow + 1, "C").Value = Range("C3")
End If
End Sub

That's it. Now go back to the worksheet and type something into C3... it
will be placed into the first empty cell in the range C5:C200.

--
Rick (MVP - Excel)


I am tracking a bank account balance and would like that whenever a new
value
is entered in cell c3, it updates the next consecutive empty cell in range
c5:c200. Please advise how I can write the formula, function or macro.

Thanks Sony


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Updatig the Next Consecutive Empty Cell in a Range

Here is different way to do what you want...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "C3" Then
On Error Resume Next
Range("C5:C200").SpecialCells(xlCellTypeBlanks)(1) = Range("C3")
If Err.Number And Range("C5") = "" Then Range("C5") = Range("C3")
End If
End Sub

--
Rick (MVP - Excel)



"Rick Rothstein" wrote in message
...
You need event code to do what you want. Try this... right click the tab
at the bottom of the worksheet where you want this functionality, select
"View Code" from the popup menu that appears and copy/paste the following
into the code window that appears...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long
If Target.Address(0, 0) = "C3" Then
LastRow = Range("C200").End(xlUp).Row
If LastRow = 5 Then Exit Sub
If LastRow = 3 Then LastRow = 5
If LastRow < 200 Then Cells(LastRow + 1, "C").Value = Range("C3")
End If
End Sub

That's it. Now go back to the worksheet and type something into C3... it
will be placed into the first empty cell in the range C5:C200.

--
Rick (MVP - Excel)


I am tracking a bank account balance and would like that whenever a new
value
is entered in cell c3, it updates the next consecutive empty cell in
range
c5:c200. Please advise how I can write the formula, function or macro.

Thanks Sony


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Updatig the Next Consecutive Empty Cell in a Range

Rick, Thank you. I will apply this and then reply. Much appreciated - Tom


"Rick Rothstein" wrote:

Here is different way to do what you want...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "C3" Then
On Error Resume Next
Range("C5:C200").SpecialCells(xlCellTypeBlanks)(1) = Range("C3")
If Err.Number And Range("C5") = "" Then Range("C5") = Range("C3")
End If
End Sub

--
Rick (MVP - Excel)



"Rick Rothstein" wrote in message
...
You need event code to do what you want. Try this... right click the tab
at the bottom of the worksheet where you want this functionality, select
"View Code" from the popup menu that appears and copy/paste the following
into the code window that appears...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim LastRow As Long
If Target.Address(0, 0) = "C3" Then
LastRow = Range("C200").End(xlUp).Row
If LastRow = 5 Then Exit Sub
If LastRow = 3 Then LastRow = 5
If LastRow < 200 Then Cells(LastRow + 1, "C").Value = Range("C3")
End If
End Sub

That's it. Now go back to the worksheet and type something into C3... it
will be placed into the first empty cell in the range C5:C200.

--
Rick (MVP - Excel)


I am tracking a bank account balance and would like that whenever a new
value
is entered in cell c3, it updates the next consecutive empty cell in
range
c5:c200. Please advise how I can write the formula, function or macro.

Thanks Sony


.

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
Updating Next Consecutive Cell in Range Stilltrader47 Excel Worksheet Functions 8 April 10th 10 06:00 AM
Consecutive date range on consecutive worksheets john3478 Excel Worksheet Functions 3 January 14th 09 10:54 PM
Insert selected cell value into next cell in range that is empty Guy[_2_] Excel Worksheet Functions 6 January 3rd 09 10:08 PM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
Finding 5 consecutive empty rows JPL Excel Programming 4 June 4th 04 11:39 AM


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