Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Every 4th Row
Hi All
Can you help me solve the following code problem that I found and altered to run off my UserForm. Private Sub Add4_Click() Dim ws As Worksheet Set ws = Worksheets("Result") StartRowNum = 5 EndRowNum = 97 For rownum = StartRowNum To EndRowNum If Trim(Sheets("Result").Range("B" & Trim(Str(rownum)))) = "" Then freerownum = rownum rownum = EndRowNum End If Next rownum ws.Cells(freerownum, 5).Value = Trim(UserForm1.Cb2.Value) + " " & Trim(UserForm1.Tb40A.Value) + " " & Trim(UserForm1.Tb40B.Value) + " " & Trim(UserForm1.Tb40C.Value) End Sub I select the data from a ListBox and it fills the boxes above on click Add4 it places the data correctly on the sheet -- my problem is that when I select the next data from the Listbox it overides the previous input -- each time I fill the TextBoxes from the Listbox I need the data to enter another row in the same column. For example after starting at Row5 ColE the next data I need to enter in Row9 ColE then Row13 ColE - so basically its every 4th Row down to 97. Hope I've explained it properly -- Many Thanks Sue |