Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Problem in excel - possible MACRO solution ?

I got this file with the trivia questions and answers.

The sheet in excel looks something like this :

A column :
Question 1
a) Answer 1
b) Answer 2
c) Answer 3
d) Answer 4

Question 2
a) Answer 1
b) Answer 2
....

B column :
+ mark in the row where the answer to the question is right.


My question is : can I make a new sheet with the question numbers and the
right answers only ? It should look something like this :

1 a
2 b
3 d
4 c
5 d
....

Ty all in advance !

Marko


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Problem in excel - possible MACRO solution ?



/-_-b wrote:
I got this file with the trivia questions and answers.

The sheet in excel looks something like this :

A column :
Question 1
a) Answer 1
b) Answer 2
c) Answer 3
d) Answer 4

Question 2
a) Answer 1
b) Answer 2
...

B column :
+ mark in the row where the answer to the question is right.


My question is : can I make a new sheet with the question numbers and the
right answers only ? It should look something like this :

1 a
2 b
3 d
4 c
5 d
...

Ty all in advance !

Marko


Hi Marko,

This formula on the other sheet might work (assuming sheet with
Questions and Answers is Sheet1)...

=ROWS($1:1) &CHOOSE(MATCH("+",INDIRECT("Sheet1!B"&MATCH("Quest ion
"&ROWS($1:1),Sheet1!$A:$A,0)+1&":B"&MATCH("Questio n
"&ROWS($1:1),Sheet1!$A:$A,0)+4),0),"a","b","c","d" )

Ken Johnson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Problem in excel - possible MACRO solution ?

On May 8, 12:02 pm, Ken Johnson wrote:
/-_-b wrote:
I got this file with the trivia questions and answers.


The sheet in excel looks something like this :


A column :
Question 1
a) Answer 1
b) Answer 2
c) Answer 3
d) Answer 4


Question 2
a) Answer 1
b) Answer 2
...


B column :
+ mark in the row where the answer to the question is right.


My question is : can I make a new sheet with the question numbers and the
right answers only ? It should look something like this :


1 a
2 b
3 d
4 c
5 d
...


Ty all in advance !


Marko


Hi Marko,

This formula on the other sheet might work (assuming sheet with
Questions and Answers is Sheet1)...

=ROWS($1:1) &CHOOSE(MATCH("+",INDIRECT("Sheet1!B"&MATCH("Quest ion
"&ROWS($1:1),Sheet1!$A:$A,0)+1&":B"&MATCH("Questio n
"&ROWS($1:1),Sheet1!$A:$A,0)+4),0),"a","b","c","d" )

Ken Johnson


If the email has broken the formula up make sure that there is a space
inside the speech marks after the word "Question" .
ie "Question " not "Question"

Ken Johnson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Problem in excel - possible MACRO solution ?

That probably won't work. Sheet1 more than likely has question text,
not just question-space-number.

Try this macro instead...

Public Sub CorrectAnswers()
Application.ScreenUpdating = False
Dim I As Long, J As Long
Do While I < WorksheetFunction.CountIf(Worksheets(1).Range("B:B "),
"+")
J = J + 1
If Worksheets(1).Range("B" & J).Value = "+" Then
I = I + 1
Worksheets(2).Range("A" & I).Value = _
"'" & I & " " & Left(Worksheets(1).Range("A" & J).Value, 1)
End If
Loop
End Sub

Ken Johnson
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
Could someone please help me with a solution to my problem? Eamon Excel Worksheet Functions 3 February 4th 10 01:36 PM
Possible Macro Solution To My Problem Robert Excel Discussion (Misc queries) 4 July 24th 09 12:03 AM
OLD PROBLEM without SOLUTION ytayta555 Excel Worksheet Functions 19 July 10th 08 07:17 PM
Macro Solution for Link Problem? Mikeice Excel Worksheet Functions 2 June 14th 05 07:49 AM
Problem vlookup -solution macro Michel8 Excel Programming 1 November 24th 04 10:52 AM


All times are GMT +1. The time now is 01:34 PM.

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"