Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default UserForms to populate cells in a worksheet

I can do this in Word with bookmarks. is there a way do this in Excel?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default UserForms to populate cells in a worksheet

The short answer is yes. But you need to amplify your requirement to allow
someone to offer a specific approach to the solution. You can use TextBox,
ListBox, ComboBox, Labels and even InputBoxes.

"Office_Novice" wrote:

I can do this in Word with bookmarks. is there a way do this in Excel?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default UserForms to populate cells in a worksheet

Sorry about that. I have a userForm with a label, a textBox, and a
CommandButton after clicking the commandButton i would like for the Text in
the TextBox to populate a specific Cell i.e. A1 then hide. any help would be
great code snippets would be ideal thanks.

"JLGWhiz" wrote:

The short answer is yes. But you need to amplify your requirement to allow
someone to offer a specific approach to the solution. You can use TextBox,
ListBox, ComboBox, Labels and even InputBoxes.

"Office_Novice" wrote:

I can do this in Word with bookmarks. is there a way do this in Excel?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default UserForms to populate cells in a worksheet

Hi

You can get the data from the userform on to the sheet by referencing
the cell you want the data to go to. i.e.

'By referencing the activecell you can pass
'a value from a form to the worksheet though
'this can be a little dodgy if the wrong cell
'is selected it can lead to loss of data
ActiveCell.Value = TextBox1.Value

'This gives you a reference to the range A1
'from there you can pass the value to it
'using "Range" will allow you to pass use
'strings as you cell references which is very
'handy if you have declared a range that you
'wish to pass the data to i.e.
'Dim MyRng as Range
'set MyRng as Range("A1")
'Range(MyRng).Value=TextBox1.value
Range("A1").Value = TextBox1.Value

'If you know exactly which cell you are
'going to use you can do without adding
'"Range" at the start and just Giving the
'range reference in square brackets
[A1].Value = TextBox1.Value

'You can move in any direction using
'offset which will reference the cell that
'is by the amount of rows and columns that
'you declare, below would reference one cell
'to the right. This can also be used with
'negative numbers i.e. (-1,0)
[A1].Offset(0, 1).Value = TextBox2.Value

'Keeping offset in mind you can reference the
'next blank row by finding the end of the data
'working your way up the sheet until a value is
'found then setting the reference to offset by
'one row this will give you the next empty row
[A65535].End(xlUp).Offset(1, 0) = TextBox3.Value

'A more reliable way of making sure you get the
'correct cell is to reference it using "Cells()"
'this works by giving the row number and then
'the column number within the brackets
Cells(1, 1).Value = TextBox1.Value

'This would be the same as offsetting 1 cell
'to the right
Cells(1, 2).Value = TextBox2.Value

'You can also pass values to the reference "Cells" i.e.
'Dim a, b As Integer
'a = 10
'b = 10
'Cells(a, b).Value = TextBox1.Value

I hope this is of some help to you this is not the be all and end of
getting values from your form into your worksheet but it should give
you an idea of how it works.

Steve
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default UserForms to populate cells in a worksheet

I'd start with Debra Dalgleish's site:
http://contextures.com/xlUserForm01.html
and
http://contextures.com/xlUserForm02.html

Office_Novice wrote:

I can do this in Word with bookmarks. is there a way do this in Excel?


--

Dave Peterson
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
Automatically populate cells based on info in another worksheet Francis Excel Worksheet Functions 2 June 10th 08 08:17 PM
Populate Order worksheet from Quote worksheet Veronica Johnson Excel Worksheet Functions 10 January 23rd 08 09:12 PM
populate cell on worksheet 2 if text is red on worksheet 1 SCrowley Excel Worksheet Functions 14 May 15th 07 09:28 PM
Userforms in a separate worksheet Paula Excel Programming 2 February 28th 07 11:28 PM
userforms and worksheet help paradise Excel Programming 1 November 1st 03 12:35 PM


All times are GMT +1. The time now is 12:07 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"