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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,214,999
Messages
6,122,645
Members
449,093
Latest member
Ahmad123098

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