Output error with VBA

ryan8200

Active Member
Joined
Aug 21, 2011
Messages
357
Based on the data and output at [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]https://ibb.co/qNmx8Lz

What is the error that caused error at 3rd column of the output ?

Below is the code that I have been using

Code:
Sub MissingHobbies()
Dim c As Integer, h As Integer, ans As Integer
ans = 9
For c = 2 To 11    ' candidates
  For h = 3 To 6  ' hobbies
  Cells(8, 1) = "Hobbies"
  Cells(8, 2) = "Candidates"
  If Cells(h, c) = "N" Then
  Cells(ans, 1) = Cells(h, 1)
  Cells(ans, 2) = Cells(1, c)
  ans = ans + 1
  Else
End If
Next h
Next c
End
End
End Sub

Appreciate if fellow members can give me a helping hand.



[/FONT]
 
Last edited by a moderator:
I read a lot of books, spent a lot of time trying to speed up work processes, and also learned a lot from trying to answer questions on forums like this one, as well as reviewing other people's solutions to the same questions.

Now, I would like to escalate the questions to a more complicated level. To extract data with status "Y" for weekday (WD) and status "N" for weekend (WE).

The anticipated outcome should be looked like this [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]https://ibb.co/R4YyYgj.

Your guidance will be greatly appreciated. [/FONT]
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Can you post that as a separate question please as it's not the same as the original issue here?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top