Is it possible to create a macro that will take a column with each row only having numbers 1-4 and replacing each number in a row with a specific letter??
i.e.
1=A
2=C
3=G
4=T
Attached is a sample sheet that this would be done to...
Is it possible to create a macro that will take a column with each row only having numbers 1-4 and replacing each number in a row with a specific letter??
i.e.
1=A
2=C
3=G
4=T
Attached is a sample sheet that this would be done to...
hi, goldbeje, can you post the expected result for your data provided?
goldbeje,
Give this a try. Change the columns() letter as necessary
![]()
Sub tgr() Dim i As Integer For i = 1 To 4 Columns("C").Replace i, Choose(i, "A", "C", "G", "T") Next i End Sub
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
@Waterserv the attached below is the expected results.
@Tigeravatar ... can I change the Columns ("C") to ("C","D") to reflect the change to both columns at once??
Thank you both for your help with this... I know this question is probably very novice.
Last edited by goldbeje; 10-26-2011 at 09:11 PM.
goldbeje,
Yes, you can change the Columns() line. It would look like:
![]()
Columns("C:D").Replace i, Choose(i, "A", "C", "G", "T")
It could be wise to use:
![]()
Sub tgr_snb() For i = 1 To 4 Columns(3).resize(,2).Replace i, mid("ACGT",i,1),xlwhole Next End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks