I have a questionnaire-table where for each question (one question per row), an "x" can be set in Columns C through F, each of them indicating a different answer (C = worst, F = best). To the right of that table in Colum L through O are sentences, each according to the answers in the columns on the left.
If there is an "x" in one Cell, I want the according sentence from the right side to be copied to another Worksheet named "Textboxes", basically allowing me to create one worksheet with all the sentences from the answers of the questionnaire. This whole table looks like this:
The Sentences on the right are 9 columns to the right to each answer on the left, meaning if the X is in column C (worst answer) the according sentence that needs to be copied is 9 columns to the right, in column L. If the X is in column D, the sentence from the cell 9 columns to the right (column M) would need to be copied and so on.
So far Ive written this Module to help copy the according sentences into the destination-worksheet named "Textboxes" but it's nor working at all.
So basically the idea / desired behaviour is:
-loop through the table
-if Cell has an "x" move 9 cells to the right to find the desired sentence
-copy the sentence from that cell to the worksheet "Textboxes" (Ideally first sentence in A1, second in A2... right now everything goes into A1 but I cant even get that to work)
Thank you so much for you help and feedback, I hope I gave good information for you to understand the problem. Thank you in advance!
If there is an "x" in one Cell, I want the according sentence from the right side to be copied to another Worksheet named "Textboxes", basically allowing me to create one worksheet with all the sentences from the answers of the questionnaire. This whole table looks like this:
The Sentences on the right are 9 columns to the right to each answer on the left, meaning if the X is in column C (worst answer) the according sentence that needs to be copied is 9 columns to the right, in column L. If the X is in column D, the sentence from the cell 9 columns to the right (column M) would need to be copied and so on.
So far Ive written this Module to help copy the according sentences into the destination-worksheet named "Textboxes" but it's nor working at all.
VBA Code:
Option Explicit
Dim cell As range
Dim range As range
Dim Workbook As Worksheet
Sub Textboxes()
'New Worksheet
Sheets.Add
'Change Name
ActiveSheet.Name = "Textboxes"
Set range = Sheets("Questionnaire1").range("C11:F113") 'C11:F13 is the range where the answers/X's could be in
For Each cell In range
If cell.Value = "x" Then
ActiveCell.Offset(0, 8).Activate
ActiveCell.Copy (Sheets("Textboxes").range("A1"))
End If
Next cell
End Sub
So basically the idea / desired behaviour is:
-loop through the table
-if Cell has an "x" move 9 cells to the right to find the desired sentence
-copy the sentence from that cell to the worksheet "Textboxes" (Ideally first sentence in A1, second in A2... right now everything goes into A1 but I cant even get that to work)
Thank you so much for you help and feedback, I hope I gave good information for you to understand the problem. Thank you in advance!