Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|