if Then Day

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
I am wondering if there is an easier way to return the first letter of the weekday in VBA other than what what I have here.

For X = 1 to 1000

If cells(x,2) = "Monday" then
cells(x,3) = "M")
Elseif cells(x,2 = "Tuesday" then
cells(x,3) = "T" and on to Sunday...

Thanks
 
I want you to learn from my case code. You should be able to easily read and understand this. Try this on other things and learn how it works and you can use it yourself next time without needing help.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I want you to learn from my case code. You should be able to easily read and understand this. Try this on other things and learn how it works and you can use it yourself next time without needing help.

Or he could learn how to use the Evaluate function. :)
 
Upvote 0
Your 100% correct

I have already been using your code with other situations changing as needed. This Forum is a great place to start the learning process.

Thanks to all.
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top