Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA- inserting multiple cell values into single textbox


Hi All,

Just wanted to know the code for inserting 3-4 cells values on a excel
sheet into a single text box on a userform. I think it might be the
offset property not sure. E.g

Range A1-D1 need the contents of all those to go into a single text box
which is created on a userform. These will automatically be added to the
text box when you press a commandbutton on the excel sheet

help?

regards


--
VBA_MAN
------------------------------------------------------------------------
VBA_MAN's Profile: http://www.excelforum.com/member.php...o&userid=32437
View this thread: http://www.excelforum.com/showthread...hreadid=522106

  #2   Report Post  
Posted to microsoft.public.excel.programming
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...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default VBA- inserting multiple cell values into single textbox

Slight typo...

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 = rngMyRange.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 ..
'rngMyRange.Offset(0, 0) & ", " & rngMyRange.Offset(0, 1) etc...

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
VLookup multiple values - sum returned values into single cell se7098 Excel Worksheet Functions 12 April 2nd 23 07:32 PM
Multiple returned values into a single cell Jeff Excel Discussion (Misc queries) 12 May 29th 09 11:41 PM
Indentify value from multiple values in a single cell Dave Excel Worksheet Functions 9 December 13th 05 06:57 AM
How to sum the values of a single cell from multiple worksheets Ratman Excel Worksheet Functions 3 September 20th 05 06:35 PM
Toggle multiple values in single cell Chandni Excel Worksheet Functions 5 February 10th 05 12:48 AM


All times are GMT +1. The time now is 12:03 PM.

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"