1,105,578 Community Members

textbox control

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
0
 

is this access or excel you are talking about

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

is this access or excel you are talking about

this is in excel i am talking about

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
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?

Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
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.

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
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.

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

Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
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
Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
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

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?

Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
0
 

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

contents = format$(c.value,"currency")
Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
ChrisPadgham
Posting Pro in Training
450 posts since Sep 2009
Reputation Points: 113 [?]
Q&As Helped to Solve: 90 [?]
Skill Endorsements: 8 [?]
 
0
 

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

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
krishnisilva
Junior Poster
122 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: