# Copy and paste a row of cells based on a number in a range

#### Lowell In the south

##### Board Regular
HI. THANKS for taking a look!!

I am attempting to get this bit of code to peform one additonal funciton.

Dim E As Range
Dim F As Range

Range("AU:BF").EntireColumn.Hidden = True

For Each F In Sheets("Window Inputs").Range("AS6:AS83")

If UCase(F.Value) = "NO" Then

For Each E In Sheets("Window Inputs").Range("AQ6:AQ83")

If E.Value = 2 Then
Range("AU:AV").EntireColumn.Hidden = False

ElseIf E.Value = 3 Then
Range("AU:AX").EntireColumn.Hidden = False

ElseIf E.Value = 5 Then
Range("AU:AZ").EntireColumn.Hidden = False

ElseIf E.Value = 6 Then
Range("AU:BB").EntireColumn.Hidden = False

ElseIf E.Value = 7 Then
Range("AU:BD").EntireColumn.Hidden = False

ElseIf E.Value = 8 Then
Range("AU:BF").EntireColumn.Hidden = False

HERE.Select
Exit Sub
End If
Next E

End If

Next F

Currently this code checks AS6:AS83 for "No" if found it then checks AQ6:AQ83 for a number 2 thru 8 if found it unhides a progressively larger range of rows depending on the number 2 through 8 found in the range. I also need it to copy a two cell row in columns "C" and "D" in the same row as the "No" in AS6:AS83. Then paste the copied values to the unhidden columns FOR ONLY the row of cells where "No" is also found in the first range. Hope this makes sense. THANKS AGAIN!!!

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### Lowell In the south

##### Board Regular
OK simplier question!!!
How can I find out where the The "NO" is in the range? The cell refrence?

Replies
4
Views
294
Replies
1
Views
294
Replies
0
Views
729
Replies
3
Views
795
Replies
0
Views
328

### Forum statistics

1,182,132
Messages
5,933,830
Members
436,914
Latest member
Young Grasshopper

### 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.

### Which adblocker are you using?

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

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