Input from user form put into specified cell.  
Author Message
TigerPhoenix





PostPosted: Visual Basic for Applications (VBA), Input from user form put into specified cell. Top

I need to set up a user form that when you put information in it and click the add button it will put it into a certain cell.

Here is what I am trying to do.

I have 13 generators and each one has a fuel tank that we need to keep track of how may inches of fuel is inside. In my user form I have a place for each tank. When the user clicks add on the form I want it to go into a specified cell. So if 13 is entered under Generator 1 that information would go under cell B2 (no matter how many times you change it. If it is for generator 1 it goes under B2). Generator 2 has an entry of 4, that would need to go into cell C2 and so on.

Any help would be appreciated.



Microsoft ISV Community Center Forums3  
 
 
Navajo





PostPosted: Visual Basic for Applications (VBA), Input from user form put into specified cell. Top

If you are using textboxes on the userform to input fuel levels then one way
would be to set the
ControlSource property of each textbox to the cell
on the worksheet where the data should appear.

So if textbox1 is for generator 1 its ControlSource property would be Sheet1!B2,
for textbox2 it would be Sheet1!C2 etc. This way you don't need an Add button
and any change on the worksheet is automatically reflected in the control.


 
 
Derek Smyth





PostPosted: Visual Basic for Applications (VBA), Input from user form put into specified cell. Top

Nice one Navajo.