Creating VBA If Statement

tyler797

New Member
Joined
May 10, 2011
Messages
7
Hi, I'm wondering if anyone would be able to help me figure out how to create an If statement in VBA. I have another thread with a different macro problem but didn't want to hijack it and confuse people with 2 problems so I created a new thread with this one. I want the macro to look at cell A1 in worksheet "CoverMirrorSheet" and if it equals "January", copy/paste (values only) A1:E34 to sheet "Data"

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
One way:
Code:
    With Worksheets("CoverMirrorSheet")
        If .Range("A1").Text = "January" Then
            .Range("A1:E34").Copy Worksheets("Data").Range("A1")
        End If
    End With
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,795
Members
452,943
Latest member
Newbie4296

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