GreekWord1 EnglishWord1 Notes1
GreekWord2 EnglishWord2 Notes2
, EnglishWord3 Notes3
GreekWord3 EnglishWord4 Notes4
GreekWord4 EnglishWord5 Notes5
. EnglishWord6 Notes6
GreekWord5 EnglishWord7 Notes7
GreekWord6 EnglishWord8 Notes8
? EnglishWord9 Notes9
GreekWord7
GreekWord8
GreekWord9

The above made-up example above may lose its formatting here but I think you will get the drift. Column A has a list of 9 Greek words WITH punctuation in separate cells making a total of 12 cells in column A. Column B & C are the English translation and notes for each Greek word. What I want to do is insert blank cells in Columns B & C to correspond with the punctuation so that the English words and notes properly align with their correct Greek word. I am not a programmer and so my attempt at the macro below does not work.

Sub Macro1()
Dim x As Integer
For x = 1 To 12
If RxC1 = "," Or RxC1 = "." Or RxC1 = "?" Then 'test if punctuation occurs
Range(Cells(x, 2), Cells(x, 3)).Select 'if punctuation occurs select cells in columns 2 & 3 for row in question
Selection.Insert Shift:=xlDown 'insert cells moving all cells down
End If
Next x
End Sub

GreekWord1 EnglishWord1 Notes1
GreekWord2 EnglishWord2 Notes2
, EnglishWord3 Notes3
GreekWord3 EnglishWord4 Notes4
GreekWord4 EnglishWord5 Notes5
. EnglishWord6 Notes6
GreekWord5 EnglishWord7 Notes7
GreekWord6 EnglishWord8 Notes8
? EnglishWord9 Notes9
GreekWord7
GreekWord8
GreekWord9

The above made-up example above may lose its formatting here but I think you will get the drift. Column A has a list of 9 Greek words WITH punctuation in separate cells making a total of 12 cells in column A. Column B & C are the English translation and notes for each Greek word. What I want to do is insert blank cells in Columns B & C to correspond with the punctuation so that the English words and notes properly align with their correct Greek word. I am not a programmer and so my attempt at the macro below does not work.

Sub Macro1()
Dim x As Integer
For x = 1 To 12
If RxC1 = "," Or RxC1 = "." Or RxC1 = "?" Then 'test if punctuation occurs
Range(Cells(x, 2), Cells(x, 3)).Select 'if punctuation occurs select cells in columns 2 & 3 for row in question
Selection.Insert Shift:=xlDown 'insert cells moving all cells down
End If
Next x
End Sub

Part of the problem with the macro, is that you can't insert a variable into an object name like that...... I know that you would expect it to say something like:
if R1C1 = "," and then on the next iteration of the loop, say something like if r2c1 = ",". It's sad, but the interpreter (vba) will not allow this to happen (mostly, because then it could not define among objects, functions, keywords, and variables). I suggest trying it with the cells (or cell) property, something like (might need modification):

for I = 1 to 12
     if cells(1, I) = "," then
           'do something
     end if
next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.