I need help creating a macro that converts contact information in 3 x 3 sections into rows. I am very new to macros and have forgotten most of my programming. There are over a hundred contacts so i don't want to this by hand. The section on the right in the attached file is what it currently looks like and I want it to look like the portion on the right. I tried to record my own and then fix it but I am unexprienced in visual basic. here is what I have so fat I tried to use i as a variable like in matlab but that did not work.
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+o
'
["code"]
i = 1
ActiveCell.FormulaR1C1 = "=RC[-4]"
Range("F" & "i").Select ""
ActiveCell.FormulaR1C1 = "=RC[-4]"
Range("Gi").Select
ActiveCell.FormulaR1C1 = "=RC[-4]"
Range("Hi").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-7]"
Range("Ii").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-7]"
Range("Ci").Select
ActiveCell.FormulaR1C1 = "Fax: 609-485-6833"
Range("Ji").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-7]"
Range("Kn").Select
ActiveCell.FormulaR1C1 = "=R[2]C[-9]"
Range("En:Mn").Select
Selection.Copy
Range("En").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("E(n+1):M(n+1)").Cut Destination:=Range("En:Mn")
Rows("(n+1)n+2)").Select
Selection.Delete Shift:=xlUp
Range("En").Select
n = n + 1
["code/"]
End Sub
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks