We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

textbox control

hi ,

i have a textbox control in one sheet and a range of data in another sheet in the same file. how do i copy the range of data in paste it in the textbox control?

appreciate a reply thanks

2
Contributors
12
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
13
Views
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

is this access or excel you are talking about

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

is this access or excel you are talking about

this is in excel i am talking about

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

this is in excel i am talking about

if you go to Deleloper Tab there is a way to add textbox i am tring to write a macro to copy data from another sheet (a range of data) and paste it to the textbox how do i do it?

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

the simplest way is to go to Tools -> Macro -> Record New Macro
manually do what want, the macro will create the VBA for you, you can then go into the Visual Basic editor to look at, improve the code.

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

the simplest way is to go to Tools -> Macro -> Record New Macro
manually do what want, the macro will create the VBA for you, you can then go into the Visual Basic editor to look at, improve the code.

yes i did that but when i do that the macro dosen't record when i paste the content to the textbox, because text box dosen't have a method paste

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0
Dim contents As String
contents = ""
For Each c In Worksheets("Sheet2").Range("a1:a4").Cells
  contents = contents & ", " & c.Value
Next c
TextBox1.Text = contents
ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5
Dim contents As String
contents = ""
For Each c In Worksheets("Sheet2").Range("a1:a4").Cells
  contents = contents & ", " & c.Value
Next c
TextBox1.Text = contents

thnaks for the help
i did that, but the only thing is can't get the format of the data range that i an putting to the textbox,
how can i do that?

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

There is a format$ function that will format things for you. for example for a money amount

contents = format$(c.value,"currency")
ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

There is a format$ function that will format things for you. for example for a money amount

contents = format$(c.value,"currency")

so if i have a format as


A $5.00 $7.00 $2.00
B $(5.00) $(9.00) $6.00
C $8.00 $(8.00) $(4.00)
D $2.00 $(9.00) $7.00

so i have something like above how to i display exactly the same way in the textbox?

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

have you looked at the Help for format$ that should tell you

ChrisPadgham
Posting Pro in Training
451 posts since Sep 2009
Reputation Points: 127
Solved Threads: 88
Skill Endorsements: 5

yes i looked at it
but the range i am going to copy it has number string $ amount so can't format into one format right
how can i do this

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

hi do you know a way of doing it????

krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5675 seconds using 2.8MB