Using VBA Entering data into cells efficiently.

mpopkowski

Board Regular
Joined
Jul 30, 2003
Messages
67
I have several rows and columns in which I need enter data. If I used a userform and asked the same question among multiple rows and columns, how can I loop this so that the information is entered and continues asking the same question until I'm through.
Also, should the information be validated to be correct.

Appreciate everyones patience,

Thanks,
Mark :oops:
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
What you're asking is kinda' vague.

Posting a bit of the sheet with your expected results will help.

If you're trying to build a "database" of results then maybe something like:

Dim LastRow As Object
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)

With LastRow
.Offset(, 0) = cmb1.Text
.Offset(, 1) = cmb2.Text
.Offset(, 2) = "=VLOOKUP(RC[-1],Master!R3C1:R250C2,2,FALSE)"
.Offset(, 3) = tb1.Text
.Offset(, 4) = tb2.Text
.Offset(, 5) = tb3.Text
.Offset(, 6) = "=SUM(RC[-2]:RC[-1])*3"
.Offset(, 7) = Date
End With

will work for you as far as returning User Form info to a sheet goes, but I'm just guessing as to what you want.

As far as validating, one way is to use If statements in a Text Box Exit event.

Hope that helps,

Smitty
 

Watch MrExcel Video

Forum statistics

Threads
1,122,507
Messages
5,596,544
Members
414,077
Latest member
ammylar5

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
Top