Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default Entering Values and Updating Next Empty Cell in a Range

Please help, I hope there is a macro.

Every time I enter a value in cell j29, I would like it to post to the next
empty cell in range b139:b150. For example, if I enter 24 and it populates
b139, the next value I enter in j29 should post in b140

Thanks - Tom
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 376
Default Entering Values and Updating Next Empty Cell in a Range

Hi
You don't say what you want to do if row 150 is already filled.
This code will do what you want, and i have stopped it at B150.
Remove the stop if that is what you want

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
If Target.Address < Range("J29").Address Then Exit Sub

lr = Cells(Rows.Count, "B").End(xlUp).Row + 1
lr = Application.Max(139, lr)


If lr 150 Then
MsgBox "Cell B150 already populated"
Exit Sub
End If

Exit Sub
Application.EnableEvents = False
Cells(lr, "B") = Target.Value
Application.EnableEvents = True

End Sub

Copy code above
Right click on sheet tabView code
Post code into white pane that appears
Alt+F11 to return to Excel

--
Regards
Roger Govier

Stilltrader47 wrote:
Please help, I hope there is a macro.

Every time I enter a value in cell j29, I would like it to post to the next
empty cell in range b139:b150. For example, if I enter 24 and it populates
b139, the next value I enter in j29 should post in b140

Thanks - Tom

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default Entering Values and Updating Next Empty Cell in a Range

Roger - I apologize for the delay in getting back to you. I just had a
chance tonight to try the code.

When I entered the 1st value in cell j29, the message "Cell B150 already
populated" displayed. However, cells b139:b150 are all empty. The value
entered in j29 did not post/populate b139 (1st cell in range) as expected. I
cannot see where the value updated anywhere.

Please review and advise update.

To reiterate, new values will be entered intermittently in cell j29. As
each new value is intered, the objective is to update it to the next empty
cell in range b139:b150.

Thanks for your help - Tom



"Roger Govier" wrote:

Hi
You don't say what you want to do if row 150 is already filled.
This code will do what you want, and i have stopped it at B150.
Remove the stop if that is what you want

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
If Target.Address < Range("J29").Address Then Exit Sub

lr = Cells(Rows.Count, "B").End(xlUp).Row + 1
lr = Application.Max(139, lr)


If lr 150 Then
MsgBox "Cell B150 already populated"
Exit Sub
End If

Exit Sub
Application.EnableEvents = False
Cells(lr, "B") = Target.Value
Application.EnableEvents = True

End Sub

Copy code above
Right click on sheet tabView code
Post code into white pane that appears
Alt+F11 to return to Excel

--
Regards
Roger Govier

Stilltrader47 wrote:
Please help, I hope there is a macro.

Every time I enter a value in cell j29, I would like it to post to the next
empty cell in range b139:b150. For example, if I enter 24 and it populates
b139, the next value I enter in j29 should post in b140

Thanks - Tom

.

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
Entering a Value & Updating the Next Empty Cell in a Range Stilltrader47 Excel Worksheet Functions 6 February 25th 10 05:17 AM
Copy Values to next empty cell range Aldo Cella Excel Worksheet Functions 1 March 10th 08 11:22 PM
entering values into a cell Sadcrab Excel Discussion (Misc queries) 0 March 5th 08 11:47 AM
Preventing user entering duplicate values in a cell range Thomas Peters Excel Worksheet Functions 1 November 30th 05 08:00 PM
Formula is entering a default time when it comes across an empty cell.. Howie Excel Worksheet Functions 10 November 16th 05 11:34 AM


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