ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   first column in row (https://www.excelbanter.com/excel-programming/335067-first-column-row.html)

Rob Hargreaves[_2_]

first column in row
 
Hi I have a userform and I have a text box called txtname

I would like to add txtname to a sheet called sheet7 in row 1's first
available column.

can you tell me how I can do this?

I know how to add it to the next available row in a column but not the next
available column in a row.

Thanks,

Rob




STEVE BELL

first column in row
 
Rob,

sounds like you are looking for something like this

Dim rw as long, col as long

col = Sheets(1).Cells(rw, Columns.Count).End(xlToLeft).Column

--
steveB

Remove "AYN" from email to respond
"Rob Hargreaves" wrote in message
...
Hi I have a userform and I have a text box called txtname

I would like to add txtname to a sheet called sheet7 in row 1's first
available column.

can you tell me how I can do this?

I know how to add it to the next available row in a column but not the
next available column in a row.

Thanks,

Rob






Bob Phillips[_7_]

first column in row
 
or to take it to the cell

Sheets(1).Cells(1, Columns.Count).End(xlToLeft).Value = txtName.Text

--
HTH

Bob Phillips

"STEVE BELL" wrote in message
news:y2wDe.23041$IJ1.14564@trnddc02...
Rob,

sounds like you are looking for something like this

Dim rw as long, col as long

col = Sheets(1).Cells(rw, Columns.Count).End(xlToLeft).Column

--
steveB

Remove "AYN" from email to respond
"Rob Hargreaves" wrote in message
...
Hi I have a userform and I have a text box called txtname

I would like to add txtname to a sheet called sheet7 in row 1's first
available column.

can you tell me how I can do this?

I know how to add it to the next available row in a column but not the
next available column in a row.

Thanks,

Rob









All times are GMT +1. The time now is 03:04 AM.

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