Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

5. Do you have any foreign language proficiency?

Answered: 1 week ago