excel VBA to select specific rows

  • Follow


I have created a userform in excel VBA use as a data entry form and I
have created this VBA code:

 iRow = ws.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row

    ws.Cells(iRow, 3) = TextBox1.Value

My problem is how to set this code to start the data from row 10 and
column 3, because currently it start from raw 2 and column 3.

Thanks very much for the help.
0
Reply dodong 5/12/2010 4:43:49 AM

ws.Cells(10, 3) = TextBox1.Value


-- 
Regards
Dave Hawley
www.ozgrid.com
"dodong" <dodonglopez@yahoo.com> wrote in message 
news:91c08d4a-5911-4569-95ca-bb9d537a2c27@u20g2000pru.googlegroups.com...
>I have created a userform in excel VBA use as a data entry form and I
> have created this VBA code:
>
> iRow = ws.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
>
>    ws.Cells(iRow, 3) = TextBox1.Value
>
> My problem is how to set this code to start the data from row 10 and
> column 3, because currently it start from raw 2 and column 3.
>
> Thanks very much for the help. 

0
Reply ozgrid 5/12/2010 7:10:38 AM

On May 12, 3:10=A0pm, "ozgrid.com" <d...@ozgrid.com> wrote:
> ws.Cells(10, 3) =3D TextBox1.Value
>
> --
> Regards
> Dave Hawleywww.ozgrid.com"dodong" <dodonglo...@yahoo.com> wrote in messag=
e
>
> news:91c08d4a-5911-4569-95ca-bb9d537a2c27@u20g2000pru.googlegroups.com...
>
>
>
> >I have created a userform in excel VBA use as a data entry form and I
> > have created this VBA code:
>
> > iRow =3D ws.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
>
> > =A0 =A0ws.Cells(iRow, 3) =3D TextBox1.Value
>
> > My problem is how to set this code to start the data from row 10 and
> > column 3, because currently it start from raw 2 and column 3.
>
> > Thanks very much for the help.- Hide quoted text -
>
> - Show quoted text -

Thanks for your quick reply. However, when I try to change with iRow
with 10 it overwrite the first data tha I entered. I need it to loop.
0
Reply dodong 5/12/2010 7:49:15 AM

I'd qualify the Rows.count, too.

with ws
   iRow = .Cells(.Rows.Count, 3).End(xlUp).Offset(1, 0).Row
   if irow < 10 then
        irow = 10
   end if
   .cells(irow,3).value = textbox1.value
end with



dodong wrote:

> I have created a userform in excel VBA use as a data entry form and I
> have created this VBA code:
> 
>  iRow = ws.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row
> 
>     ws.Cells(iRow, 3) = TextBox1.Value
> 
> My problem is how to set this code to start the data from row 10 and
> column 3, because currently it start from raw 2 and column 3.
> 
> Thanks very much for the help.

-- 

Dave Peterson
0
Reply Dave 5/12/2010 12:01:43 PM

3 Replies
1697 Views

(page loaded in 0.075 seconds)


Reply: