Answered step by step
Verified Expert Solution
Question
1 Approved Answer
So my job is to write a code in Excel with VBA to decrypt letters up by 5. Example a to f, b to g,
So my job is to write a code in Excel with VBA to decrypt letters up by 5. Example a to f, b to g, z to e etc.
My issue is that It worked just fine when I put a single letter like "a", but when I put "ab" or "a b", it didn't give me the results that I wanted which were "fg" and "f g" respectively. It gave me like "ab" and "a b" instead.
Please help me correct my code thank you
Ps. don't worry about the capital letters because I only deal with small letters
Option Explicit Sub Fancy () Dim ascii As Long Dim x As String Dim v As String x = InputBox ("place your code here") If x Like "[a-z]" Then ascii = Asc (x) + 5 If asc11 122 Then ascii = ascii - 26 v = chr (ascii) Else v=x End If MsgBox v End Sub
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started