Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Loop based on number entered in userform

Hi

I have a simple userform with TextBox1, the user enters a value in
here and then based on this value does some work on that row, and i
want it to then move down a row and do the work again for the number
of rows in textbox1. How do I do a loop and count to do this please?

i.e

rowend= Me.TextBox1.Value
set a value for the counter

Start loop

If rowend=counter then end
Else
Do something
ActiveCell.Offset(1, 0).Activate
add 1 to counter
go back to start of loop

Cheers

Rich
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 269
Default Loop based on number entered in userform

The code would be like this

rowend= Me.TextBox1.Value
set a value for the counter

For A=1 to countervalue
Do something
ActiveCell.Offset(1, 0).Select
Next A

--
If this helps, please remember to click yes.


"Richhall" wrote:

Hi

I have a simple userform with TextBox1, the user enters a value in
here and then based on this value does some work on that row, and i
want it to then move down a row and do the work again for the number
of rows in textbox1. How do I do a loop and count to do this please?

i.e

rowend= Me.TextBox1.Value
set a value for the counter

Start loop

If rowend=counter then end
Else
Do something
ActiveCell.Offset(1, 0).Activate
add 1 to counter
go back to start of loop

Cheers

Rich

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
Need to set up a number based on date entered teeech Excel Discussion (Misc queries) 1 July 25th 09 10:13 AM
Loop through userform Paul Morgan Excel Discussion (Misc queries) 2 March 10th 08 10:12 AM
how can i re-populate a userform with data already entered? Paul Dye New Users to Excel 1 January 24th 07 04:49 AM
How easy is it to loop in VBA based on cell contents? Lee Harris Excel Worksheet Functions 3 November 25th 05 01:21 AM
Changing chart color based on number entered confused chart girl Charts and Charting in Excel 0 October 27th 05 05:26 PM


All times are GMT +1. The time now is 10:11 AM.

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"