#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Next Row

Hi All
I have been using the code below -- Cmd1 is a list box with 24 names what I
need is when I click on the next name on the list it will insert the data on
the next row down. At the moment I understand that its selecting a range "D2"
etc so every time I add it replaces the value in "D2"etc and not in "D3"
which is the next row --- I hope I've explained this OK

Private Sub Add6_Click()



startrownum = 2
endrownum = 25
For rownum = startrownum To endrownum
If Trim(Sheets("ClubsPayment").Range("A" & Trim(Str(rownum)))) = "" Then
freerownum = rownum
rownum = endrownum
End If
Next rownum

Sheets("ClubsPayment").Range("D" & Trim(Str(freerownum))) = Cmd1.Value
Sheets("ClubsPayment").Range("D2") = Box2.Value
Sheets("ClubsPayment").Range("E2") = Box3.Value
Sheets("ClubsPayment").Range("F2") = Box9.Value
Sheets("ClubsPayment").Range("G2") = Box10.Value
Sheets("ClubsPayment").Range("H2") = Box11.Value
Sheets("ClubsPayment").Range("I2") = Box12.Value
Sheets("ClubsPayment").Range("J2") = Box13.Value
Sheets("ClubsPayment").Range("K2") = Cmd3.Value
Sheets("ClubsPayment").Range("L2") = Box14.Value


End Sub




--
Many thanks

hazel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Next Row


Lets see if I got this correct, if you are on row 1, you want the
selections to go into the proper columns in row 1

if you are on row 2 you want the selections to go into the proper
columns in row 2

is this correct??


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=516484

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Next Row

Hi

Thats correct -- however when I change the name in the drop down list Cmd1
-- its then that I want it to go from row 2 with the columns filled to row 3
and fill the columns with the new values I have entered. When I change the
name in Cmd1 it clears the boxes ready for the new data to be entered.
--
Many thanks

hazel


"davesexcel" wrote:


Lets see if I got this correct, if you are on row 1, you want the
selections to go into the proper columns in row 1

if you are on row 2 you want the selections to go into the proper
columns in row 2

is this correct??


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=516484


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Next Row


Sorry I never got back to you, have you gotten a reply yet??


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=516484

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



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