I'm trying to set a range to a variable, then copy and paste the first three columns of that range to the right by one column. Thinking my syntax on the copy/paste is off slightly as the code errors out during the set statement of the CopyFrom variable. The WRange variable will be set by a select case based on a drop down list from a user form, but the copy/paste action should be consistent no matter which range is set to the WRange variable as it will always be a range 4 columns wide by 3 rows tall.
Here's my current code:
Here's my current code:
VBA Code:
Dim WRange As Range
Dim CopyFrom As Range, CopyTo As Range
Set WRange = Range("B15:E17")
Set CopyFrom = WRange(.Cells(1, 1), .Cells(3, 3))
Set CopyTo = WRange(.Cells(1, 2), .Cells(3, 4))
CopyFrom.Copy CopyTo