Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Value from form to excel sheet

Hi guys..
I have an excel sheet and a userform.
When user open the form , they will answer some of the questions like
yes /no in the textboxes, I have to record these answers in the
worksheet.
It should be happend for a loop, like if l give the range 1 to 100, it
should open the form 100times allow to enter the data and store it in
the sheet in the cells ,lets call answer1 to answer 10.
so the cellreference will be like :

Sheets("Mysheet").Range("Answer1 " & i)=userform1.txtanswer1.text

....

How can i do this...

thanks..

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Value from form to excel sheet

XL97: How to Use a UserForm for Entering Data (Q161514)
http://support.microsoft.com/?id=161514


XL2000: How to Use a UserForm for Entering Data (Q213749)
http://support.microsoft.com/?id=213749


--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Hi guys..
I have an excel sheet and a userform.
When user open the form , they will answer some of the questions like
yes /no in the textboxes, I have to record these answers in the
worksheet.
It should be happend for a loop, like if l give the range 1 to 100, it
should open the form 100times allow to enter the data and store it in
the sheet in the cells ,lets call answer1 to answer 10.
so the cellreference will be like :

Sheets("Mysheet").Range("Answer1 " & i)=userform1.txtanswer1.text

...

How can i do this...

thanks..



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Value from form to excel sheet

Hi Tom.
This is ok.. But my case is different.
I am working out this partiuclar bit in between some other works
through loops..

I am calling a loop from say 1 to 100 and it will do many other
validations and scoring in each time and after that it will display
some details of the row like name , number etc from the sheet and asks
for this answers.. so if i use the loop and way of adding, how can i
get the aorrect answers of each row into the sheet..

You got me.??
when i use the

userform1.show
the value of the 'i' for loop may be 10 ( lets say like that) , so it
should add the value to the 10th column.

I added a button on the screen to add it, but how can i get that value
of 'i' in the form .

thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Value from form to excel sheet

Make i a public variable in the module with the code that calls the
userform. Then the userform can see i and use it in its code.


At the top of the general module

Public i as Long

then don't declare it again in your sub or you will be working with a
different (local) version of i.
--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Hi Tom.
This is ok.. But my case is different.
I am working out this partiuclar bit in between some other works
through loops..

I am calling a loop from say 1 to 100 and it will do many other
validations and scoring in each time and after that it will display
some details of the row like name , number etc from the sheet and asks
for this answers.. so if i use the loop and way of adding, how can i
get the aorrect answers of each row into the sheet..

You got me.??
when i use the

userform1.show
the value of the 'i' for loop may be 10 ( lets say like that) , so it
should add the value to the 10th column.

I added a button on the screen to add it, but how can i get that value
of 'i' in the form .

thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Value from form to excel sheet

depending upon the crontol you are using (if dropdown or listboxes the
selcted item is 0 based)
Else
if you have named the contol its just
controlname.value

So it would be something like
For i = 1 to controlname.value
would let to loop until the value +1 stored in controlname was reached.





wrote in message
oups.com...
Hi Tom.
This is ok.. But my case is different.
I am working out this partiuclar bit in between some other works
through loops..

I am calling a loop from say 1 to 100 and it will do many other
validations and scoring in each time and after that it will display
some details of the row like name , number etc from the sheet and asks
for this answers.. so if i use the loop and way of adding, how can i
get the aorrect answers of each row into the sheet..

You got me.??
when i use the

userform1.show
the value of the 'i' for loop may be 10 ( lets say like that) , so it
should add the value to the 10th column.

I added a button on the screen to add it, but how can i get that value
of 'i' in the form .

thanks





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Value from form to excel sheet

Thanks Tom...its working ...thanks...

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
How do i get an form to fill up my excel sheet? raj Excel Discussion (Misc queries) 1 May 16th 09 04:12 PM
How do I split form controls in a sheet in excel? Desperateticha Excel Discussion (Misc queries) 1 November 9th 07 01:57 PM
Access Form to Excel sheet KevinKBM Excel Discussion (Misc queries) 1 August 3rd 07 09:02 AM
Toggle between excel sheet and user form Omar Excel Programming 2 March 1st 05 07:11 AM
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? Daniel[_14_] Excel Programming 1 August 29th 04 01:20 PM


All times are GMT +1. The time now is 08:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"