VBA help with IF function

DrH100

Board Regular
Joined
Dec 30, 2011
Messages
78
I really struggle with IF in VBA and have no idea where to go with this as there are two criteria to match.

I have a simple enough work book with two sheets - in sheet1 the user inputs a day in A1 (from drop down) and an indicator (either 1 or 2) in B1

What I am trying to do is

IF A1 = Monday and B1 = 1 copy column C and paste in Sheet2
IF A1 = Monday and B1 = 2 copy column D and paste in Sheet2
IF A1 = Tuesday and B1 = 1 copy column E and paste in Sheet 2
If A1 = Tuesday and B1 = 2 copy column F and paste in Sheet 2

And so on through to Friday

Can someone advise where the best place to start is. Once I've got two or three IF's in place I can usually add the others in but I can't seem to find any examples of more than one criteria.

If anybody has any links to "simple" to understand guides to using IFs in VBA I would be most grateful also as I feel that this is something that I should be able to understand but can't get my head around at all at the moment.

Many thanks for any help in advance
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Basically you just put ANDs or ORs between complete criteria.

If Range("A1")="Monday" And Range("B1")=1 Then ...
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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