ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Output from a userform finding the right column. column (https://www.excelbanter.com/excel-programming/290879-output-userform-finding-right-column-column.html)

HelpMe

Output from a userform finding the right column. column
 
Here is what I am tring to do. I have a userform that people will inpu
data into then I want to place that on a worksheet starting in (E4:E30
then I have a button that I want to allow them to enter new data an
have that be put in the next row (D4:D30). So I need to be able to fin
the last row that has something in Row 4. Here is what I have now
Thanks for any help. By the way this isn't close I don't think.

Private Sub NextButton2_click()
Sheets("INLETS").Unprotect
Sheets("MACROS").Unprotect

Dim LastRow As Object


Sheets("Inlets").Activate

Dim Cl
Cl = Range("4IV").End(xlRight).Offset(0, 1).Select (DOESN'T WOR
with 4IV)


Cells(4, Cl).Value = TextBox1.Value
Cells(6, Cl).Value = DrainArea.Value
Cells(7, Cl).Value = T.Value
Cells(9, Cl).Value = C.Value
Cells(11, Cl).Value = Qc.Value
Cells(12, Cl).Value = TextBox2.Value
Cells(14, Cl).Value = SO.Value
Cells(15, Cl).Value = SX.Value
Cells(18, Cl).Value = SIDES.Value
Cells(26, Cl).Value = L.Value
Cells(30, Cl).Value = HCURB.Value
Cells(31, Cl).Value = HSUMP.Value
Cells(34, Cl).Value = QOTHER.Value
Cells(30, Cl).Value = CUMUFLOW.Value
Cells(16, Cl).Value = PAVWIDTH.Value

' adds 1 column -see module 1 for code
Call AddCol
' recopies title header see module 1
Call RefreshHeader
' see module2 for code
Call HeaderChk

Sheets("MACROS").Protect
Sheets("INLETS").Protect

End Su

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Output from a userform finding the right column. column
 
cl = Range("IV4").End(xltoLeft).Offset(0, 1).Column


--
Regards,
Tom Ogilvy




"HelpMe " wrote in message
...
Here is what I am tring to do. I have a userform that people will input
data into then I want to place that on a worksheet starting in (E4:E30)
then I have a button that I want to allow them to enter new data and
have that be put in the next row (D4:D30). So I need to be able to find
the last row that has something in Row 4. Here is what I have now.
Thanks for any help. By the way this isn't close I don't think.

Private Sub NextButton2_click()
Sheets("INLETS").Unprotect
Sheets("MACROS").Unprotect

Dim LastRow As Object


Sheets("Inlets").Activate

Dim Cl
Cl = Range("4IV").End(xlRight).Offset(0, 1).Select (DOESN'T WORK
with 4IV)


Cells(4, Cl).Value = TextBox1.Value
Cells(6, Cl).Value = DrainArea.Value
Cells(7, Cl).Value = T.Value
Cells(9, Cl).Value = C.Value
Cells(11, Cl).Value = Qc.Value
Cells(12, Cl).Value = TextBox2.Value
Cells(14, Cl).Value = SO.Value
Cells(15, Cl).Value = SX.Value
Cells(18, Cl).Value = SIDES.Value
Cells(26, Cl).Value = L.Value
Cells(30, Cl).Value = HCURB.Value
Cells(31, Cl).Value = HSUMP.Value
Cells(34, Cl).Value = QOTHER.Value
Cells(30, Cl).Value = CUMUFLOW.Value
Cells(16, Cl).Value = PAVWIDTH.Value

' adds 1 column -see module 1 for code
Call AddCol
' recopies title header see module 1
Call RefreshHeader
' see module2 for code
Call HeaderChk

Sheets("MACROS").Protect
Sheets("INLETS").Protect

End Sub


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com