Declaring an array

Robert E Lee

Active Member
Joined
Aug 10, 2005
Messages
266
Hi All

I have a workbook with a number of sheets and a second workbook containing data that is to be entered into the first workbook base on a selection parameter. This parameter I have called BC and is contained in block with differing numbers of parameters in Range ("A2") to Range ("A" & 2 +N)

Code:
 For Each BC In BR


Set TR = Range(ActiveCell, ActiveCell.Offset(R1, 0))
                               For Each c In TR
                                           If c =BC Then
                                           
                                           Set SelectRange = Range(c.Offset(0, -2), (c.Offset(0, 3)))
                                           
                                           SelectRange.Copy Destination:=rs.Range("A" & R)
                                           R = R + 1
                                           End If
                
                               Next c

It all works perfectly except that BC always seems to contain nothing so the range to be copied is not selected. (So not so perfect then)

Any assistance appreciated

Rob
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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