#1   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default User Form Problem


I have done some reading on using User Forms within VBA.

I am taking data from the form and putting it to an Excel worksheeet.

Here is the code I have so far... This all works...

Private Sub cmdSaveData_Click()
Dim LastRow As Object
Sheets("DailyData").Select

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = txtDate.Text
LastRow.Offset(1, 1).Value = txtRawPounds.Text
LastRow.Offset(1, 2).Value = txtRawSolids.Text
LastRow.Offset(1, 3).Value = txtFrenchFryPounds.Text
LastRow.Offset(1, 4).Value = txtBatterPounds.Text
LastRow.Offset(1, 5).Value = txtFrSpPounds.Text
LastRow.Offset(1, 6).Value = txtUnFrSpPounds.Text
LastRow.Offset(1, 7).Value = txtBakedPounds.Text
LastRow.Offset(1, 8).Value = txtFrenchFryOil.Text
LastRow.Offset(1, 9).Value = txtFrSpOil.Text
LastRow.Offset(1, 10).Value = txtBatterOil.Text
LastRow.Offset(1, 11).Value = txtBatterPowder.Text
LastRow.Offset(1, 12).Value = txtFrenchFrySolids.Text
LastRow.Offset(1, 13).Value = txtBatterSolids.Text
LastRow.Offset(1, 14).Value = txtFrSpSolids.Text
LastRow.Offset(1, 15).Value = txtUnFrSpSolids.Text
LastRow.Offset(1, 16).Value = txtBakedSolids.Text

' <---------Question Area---------

Unload Me
End Sub

The User Form will be compased of six tabbed pages of input, the above
is from the first page.

I need to know how to write the code to have the LastRow.offset(1,17)
do a calculation based on adding the pounds from the production lines
(Offset 1,3 throught 1,7 above) and dividing by the raw pounds (Offset
1,1 above)

I have tried several things, but I always seem to get an absolute
reference and the next new row has the same result as the previous
existing row.

Thanks for the help in the past, I know this is something I will
probably slap my forehead and so "Dummy!"


--
DCSwearingen


------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=496826

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Form Error theguz Excel Discussion (Misc queries) 3 August 15th 05 10:49 PM
Dialog & User Form bach New Users to Excel 2 August 13th 05 09:35 PM
Positioning 2 User Forms mully New Users to Excel 3 June 11th 05 08:15 PM
Printing Part of User Form mully New Users to Excel 1 May 26th 05 08:22 AM
Trying to delete form border, and it deletes all borders PeterM Excel Discussion (Misc queries) 11 January 3rd 05 03:36 PM


All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"