L
Legacy 169354
Guest
Hi,
I have a standard vba script that adds a form data to rows and then increments to the next row to add further data.
this script works fine on a new sheet i created, but if i change the sheet to one already made then the rowcount gets tricked into thinking the cells are full up to excels limit(65536)! This sheet I need it in contains merged cells (which need to be there) but as I am using "b1" it is counting only single cells so it should be ok.
My question is: What can trick the rowcount into thinking there is data in cells than there is really is? !!
I have a standard vba script that adds a form data to rows and then increments to the next row to add further data.
this script works fine on a new sheet i created, but if i change the sheet to one already made then the rowcount gets tricked into thinking the cells are full up to excels limit(65536)! This sheet I need it in contains merged cells (which need to be there) but as I am using "b1" it is counting only single cells so it should be ok.
My question is: What can trick the rowcount into thinking there is data in cells than there is really is? !!
'write data to worksheet AND check previous row for duplicate entry
Dim RowCount As Long
RowCount = Worksheets("Data").Range("b1").CurrentRegion.Rows.Count
With Worksheets("Data").Range("b1")
.Offset(RowCount, 0).Value = Me.txt_refnum.Value
.Offset(RowCount, 1).Value = DateValue(Me.txt_date.Value)
.Offset(RowCount, 2).Value = Me.txt_time.Value
.Offset(RowCount, 3).Value = Me.txt_port.Value
.Offset(RowCount, 4).Value = Me.Combo_phase_flt.Value
.Offset(RowCount, 5).Value = Me.Combo_species.Value
.Offset(RowCount, 6).Value = Me.Combo_effect.Value
End With
Last edited by a moderator: