LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 
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 12:37 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"