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

Lowell In the south

Board Regular
Joined
Sep 26, 2002
Messages
55
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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,143,742
Messages
5,720,596
Members
422,292
Latest member
Bernd0501

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
Top