473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

copy from spreadsheet to textbox

hi,

i am new to this forum and i have searched everywhere for the answer to my problem

hope someone can help with example code

what i would like to do is
copy cell contents from excel worksheet and paste info into a textbox on a user form.

the info will be updated so i would really like to know how it can automatically refresh the info from the spreadsheet to the form

i did read on another posting that the doevent worked but i could not get it to refresh the form - it is only one form that i want to refresh.

i am using excel 2003 sp2

thnak you
Nov 1 '07 #1
5 1239
danp129
323 Expert 256MB
hi,

i am new to this forum and i have searched everywhere for the answer to my problem

hope someone can help with example code

what i would like to do is
copy cell contents from excel worksheet and paste info into a textbox on a user form.

the info will be updated so i would really like to know how it can automatically refresh the info from the spreadsheet to the form

i did read on another posting that the doevent worked but i could not get it to refresh the form - it is only one form that i want to refresh.

i am using excel 2003 sp2

thnak you
In the sheet that's being used
Expand|Select|Wrap|Line Numbers
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     Range("a1", Cells.SpecialCells(xlCellTypeLastCell)).Copy
  3.     UserForm1.TextBox1.Paste
  4. End Sub
Nov 1 '07 #2
In the sheet that's being used
Expand|Select|Wrap|Line Numbers
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     Range("a1", Cells.SpecialCells(xlCellTypeLastCell)).Copy
  3.     UserForm1.TextBox1.Paste
  4. End Sub
hi,

sorry i am having problems with your code
you said in the sheet that is being used - but where do i put the code in the vba screen - is it in sheet3 or is it in somewhere else - i have tried to put it in sheet3 (double clicked sheet3 then copied your code into the blank page ) but its not working

thank you for helping
Nov 1 '07 #3
danp129
323 Expert 256MB
Is the user form in the same workbook and called userform1?
Nov 1 '07 #4
Is the user form in the same workbook and called userform1?
i am wanting to take info from sheet3!e1 to userform6 textbox1
the info in the worksheet (sheet3!e1) is from a formula - but i dont want to click on anything to copy the info from cell e1 to the textbox - can this be done or would i have to add a button so that the info goes from the cell to the textbox?

sorry i am being really picky

thank you for all your help
Nov 1 '07 #5
i am wanting to take info from sheet3!e1 to userform6 textbox1
the info in the worksheet (sheet3!e1) is from a formula - but i dont want to click on anything to copy the info from cell e1 to the textbox - can this be done or would i have to add a button so that the info goes from the cell to the textbox?

sorry i am being really picky

thank you for all your help

hi,
i have found the answer

here it is if any one else has this problem

right click on textbox
click on properties
in controlsource - type in either the cell reference(a1) or sheet1!a1 or whatever sheet you are needing to go into

thanks
Nov 1 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: (Pete Cresswell) | last post by:
I see this coming on a develpment effort that may materialize shortly. These guys don't want to mess around with automated imports from text feeds BC in the past they've had too many problems...
1
by: Kevin | last post by:
Hi How Do i copy a cell value from an excel spreadsheet into a table in access on open of the Database? eg Spreadsheet has a worksheet(Sheet1)in cell A1 the Value of "Kev" I want to copy cell...
0
by: StepHenHairNet | last post by:
A quick question about the ActiveX Spreadsheet control in Office 2000 Web Components… I’m using these in a VB.net project and wish to do something within a “hidden” OWC Spreadsheet. By...
9
by: CGW | last post by:
I asked the question yesterday, but know better how to ask it, today: I'm trying to use the File.Copy method to copy a file from a client to server (.Net web app under IIS ). It looks to me that...
0
by: Tom | last post by:
I need to be able to copy and paste data from an Excel spreadsheet to a grid or something to a web form and then save it to the database. example: if my spreadsheet has 20 rows of data I need to be...
1
by: aspiring geek | last post by:
Hi all, I'm new to asp.net, and using Visual Web Dev express. As such I cannot see the spreadsheet control and directly access the object properties from the VB code in the back of my page. ...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
2
by: TheDr | last post by:
Hello. New to this site and to VB as you're about to discover... My problem seems simple: I require to copy values from my VB program to populate a spreadsheet. More Specifically the values...
0
by: damiencarr | last post by:
i have a spreadsheet/worksheet called "NTH_Alliance" containing rows of related data grouped together under different headings, that are named as different weeks (e.g. Week 5 (26/01/2009 -...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.