Save at the first empty row (UserForm- vba)

Bushra

New Member
Joined
May 27, 2024
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hello,
Hope you are doing well
Useing the following code, why the (LastRow) varialbe had the value (270) and start saving from the next row to 270.

Dim LastRow As Integer
With Worksheets("MainDataProject")
LastRow = Sheet1.Cells(Sheet1.Rows.Count, "B").End(xlUp).Row + 1
Cells(LastRow, 2).Value = Me.MainActivitiesPrpjectComboBox.Value
Cells(LastRow, 3).Value = Me.SecodarProActivi1ComboBox.Value
Cells(LastRow, 4).Value = Me.ComboBox13.Value
End With
If LastRow >= 1 Then
Sheet1.Range("A" & LastRow).Value = LastRow + 1
End If
LastRow = WorksheetFunction.CountA(Sheets("MainDataProject").Range("A:D"))

End Sub


HELP PLAESE
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,216,499
Messages
6,131,012
Members
449,613
Latest member
MedDash99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top