LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default need help in the code

in the below I am unable to get the for next loops to recall the inputs
stored in a String variable.

My below code works, but it takes the last value of the string and proceeds.
I want it to ask the same questions for all the stored string values.
Could you provide me the solution?

My code :

Dim groupamount
Dim groupname As String
Dim i As Long
Dim d As Long

' This section Gets Group Names

groupamount = InputBox("how many groups have you made?")
ActiveCell.Offset(4, 2).Insert
If groupamount < "" Then
For i = 1 To groupamount
groupname = InputBox("what is the name of your group " & i)
ActiveCell.Offset(i, 0).Value = groupname
Next i
d = groupamout - 1
End If

' This section captures Threats
Dim Threatnumber
Dim increase As Long
Dim threatname As String
Dim decrease As Long

Threatnumber = InputBox("How many threats do you foresee for " & groupname &
" group?")

If Threatnumber < "" Then
For increase = 1 To Threatnumber
threatname = InputBox("what is the name of your " & increase & "
threat?")
ActiveCell.Offset(8, 4).Insert
ActiveCell.Offset(increase, 4).Value = threatname
Next increase
End If
 
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
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
close form code tkaplan Excel Discussion (Misc queries) 1 June 3rd 05 10:49 PM


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