View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
JennLee JennLee is offline
external usenet poster
 
Posts: 14
Default Send data from userform to specific cell on specific sheet?

I DO need the code to continue to insert the other data at last empty row. I
realized that I had added a row at the BOTTOM of my sheet that had formulas
to calculate the data that is sent from the userform. So that's why when I
entered the code you gave me, it WORKED by putting that specific data from
the form into B25 but then the other data went under it since that was last
empty row!! Clear as mud?!! SO I moved that formula row to the top
(instead of row 25 and it worked fine) I typed under the commandbutton1 Dim
Sheet As Object then the code you gave me, adding Set in front of it and it
worked. Then I added the same Set code for the additional two textboxes that
I wanted in specific cells and it hung up. Can you tell what I might have
done wrong?
Thanks so much for your help.
--
Jennifer Lee
IS Coordinator/App Support


"Vergel Adriano" wrote:

Where you put the code that I (and the others) gave you depends on when you
want it to execute. Since you're using a form, I would assume you want it to
happen at the click of a button. If so, what you need to do is open the user
form in the VBA IDE and double click the button that will trigger this
action. You should now be in the code window, with your cursor inside a sub
procedure. That is where you would put the code that you want to execute
when the button is closed.

As for the other lines of code that you have, where do you have them right
now? And, do you need them to do what they're doing? If not, simply delete
or comment them out.





"JennLee" wrote:

Thanks so much - it worked as far as sending that data to the cell on the
worksheet BUT I didn't know where in the code to put that line of code so I
typed it under all of those LastRow codes. That made all those entries that
WERE going into row 2, row 3, etc to NOW going up under the B25 where I
wanted that specific data to go to. PLEASE HELP AGAIN!!! So much
appreciated!
--
Jennifer Lee
IS Coordinator/App Support


"Vergel Adriano" wrote:

As an example, let's say you wanted to put the text in TextBox1 to cell A1 in
Sheet2:

Sheet2.Range("A1").Value = TextBox1.Text

There are many ways to refer to a cell in a worksheet, but I think the one
above is the easiest to follow.


"JennLee" wrote:

Can someone PLEASE tell me how to send data from the userform to a specific
cell on a specific worksheet? I have most entries going to each row via the
example code found on Microsoft.com and it works great:

Dim LastRow As Object
Set LastRow = Sheet2.Range("a65536").end(xlUp)

LastRow.Offset(1, 0).Value = TextBox7.Text
LastRow.Offset(1, 1).Value = ComboBox1.Text etc., etc, etc.

BUT I need for a couple of textboxes and a combo box on the userform to go
to a specific cell on Sheet2. PLEASE HELP!!!!! This has stressed me out
tremendously today!!
--
Jennifer Lee
IS Coordinator/App Support