Don't use global variables if you don't need to. Declare your variables as local as possible and as close tho their first use as possible. If you need ot submit a variable to another function/sub submit it as parameter.
Choose good names for your variables and functions. RandInteger for example is very confusing. You name your function something with Integer but it returns a String (text). Instead give it a meaningful name eg CreateRandomDNA() and submit the Length you want the DNA to be as parameter.
Option Explicit
Public Sub dna()
Dim lengthDNA As Long
' get DNA length from user input, allow user to press cancel
Dim ReturnValue As Variant
ReturnValue = Application.InputBox(Prompt:="Enter the length of DNA sequences (10-250)", Type:=1) 'Type:=1 Allow numbers only
If VarType(ReturnValue) = vbBoolean And ReturnValue = False Then
'user pressed cancel
Exit Sub
Else
lengthDNA = ReturnValue
End If
Dim dna1 As String
dna1 = CreateRandomDNA(lengthDNA)
Dim dna2 As String
dna2 = CreateRandomDNA(lengthDNA)
MsgBox "DNA Sequence 1 is: " & dna1 & vbCrLf & "DNA Sequence 2 is: " & dna2, vbInformation
End Sub
Public Function CreateRandomDNA(ByVal Length As Long) As String
Dim dnaBank As Variant
dnaBank = Array("A", "C", "G", "T")
Randomize
Dim strRandom As String
Dim x As Long
For x = 1 To Length
strRandom = strRandom & dnaBank(Int((UBound(dnaBank) - LBound(dnaBank) + 1) * Rnd + LBound(dnaBank)))
Next x
CreateRandomDNA = strRandom ' return random string to function
End Function
If you need to create different strings like DNA, RNA, Amino Acids (for proteins) you can do that in one function too:
Option Explicit
Public Enum BioCodeType
bctDNA
bctRNA
bctAminoAcidSingleLetter
bctAminoAcidMultiLetter
End Enum
Public Sub dna()
Dim sequenceLength As Long
Dim ReturnValue As Variant
ReturnValue = Application.InputBox(Prompt:="Enter the length of DNA sequences (10-250)", Type:=1) 'Type:=1 Allow numbers only
If VarType(ReturnValue) = vbBoolean And ReturnValue = False Then
'user pressed cancel
Exit Sub
Else
sequenceLength = ReturnValue
End If
Dim dna As String
dna = CreateRandomBioString(sequenceLength, bctDNA)
Dim rna As String
rna = CreateRandomBioString(sequenceLength, bctRNA)
Dim aminoSingle As String
aminoSingle = CreateRandomBioString(sequenceLength, bctAminoAcidSingleLetter)
Dim aminoMulti As String
aminoMulti = CreateRandomBioString(sequenceLength, bctAminoAcidMultiLetter)
MsgBox "DNA Sequence is: " & dna & vbCrLf & _
"RNA Sequence is: " & rna & vbCrLf & _
"Amino Acid Sequence (single letter) is: " & aminoSingle & vbCrLf & _
"Amino Acid Sequence (multi letter) is: " & aminoMulti & vbCrLf _
, vbInformation
End Sub
Public Function CreateRandomBioString(ByVal Length As Long, ByVal BioCode As BioCodeType) As String
Dim Bank As Variant
Dim Seperator As String
Select Case BioCode
Case bctDNA
Bank = Array("A", "C", "G", "T")
Case bctRNA
Bank = Array("A", "C", "G", "U")
Case bctAminoAcidSingleLetter
Bank = Array("A", "R", "N", "D", "C", "E", "Q", "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V")
Case bctAminoAcidMultiLetter
Bank = Array("ALA", "ARG", "ASN", "ASP", "CYS", "GLU", "GLN", "GLY", "HIS", "ILE", "LEU", "LYS", "MET", "PHE", "PRO", "SER", "THR", "TRP", "TYR", "VAL")
Seperator = "-"
End Select
Dim bankSize as Long
bankSize = UBound(Bank) - LBound(Bank) + 1
Dim bankMin As Long
bankMin = LBound(Bank)
Randomize
Dim strRandom As String
Dim x As Long
For x = 1 To Length
strRandom = strRandom & IIf(strRandom <> vbNullString, Seperator, vbNullString) & Bank(Int(bankSize * Rnd + bankMin))
Next x
CreateRandomBioString = strRandom
End Function
and it will return something like

RandInteger = strRandombeforeEnd functionor your function never returns a value.