View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
cheesey_toastie cheesey_toastie is offline
external usenet poster
 
Posts: 20
Default VBA- inserting multiple cell values into single textbox

You dont need to use the offset but this is the simpliest way.


Dim rngmyrange As Range

'Change the sheet name to the relevant sheet
Set rngmyrange = ActiveWorkbook.Sheets("Sheet1").Range("A1")

'change dialogsheets(1).editboxes(1) to represent your userform and
text box names...
DialogSheets(1).EditBoxes(1).Text = ngmyrange.Offset(0, 0) &
rngmyrange.Offset(0, 1) & rngmyrange.Offset(0, 2) &
rngmyrange.Offset(0, 3)


' you might want to add in some spaces or commas ..
'ngmyrange.Offset(0, 0) & ", " & rngmyrange.Offset(0, 1) etc...