Help fixing a code

Xineq

New Member
Joined
Aug 29, 2014
Messages
34
Hey mr excel

i'm atm working on this code:

Code:
If Sheets("Counting").Range(i, "R").Value = Sheets("Overview 2014-4").Range("Q1").Value Then
        Sheets("Counting").Range("S:W").Row.Copy Destination:=Sheets("Overview 2014-4").Cells(Rows.Count, "Q").End(xlUp).Offset(1, 0)
    End If


  • First part of the code, will seach my counting and see if any data in my R column is equal to my overview 2014-4 Q1 data.
  • Next up if its a match, it will copy the data from (S to W) in that row and then past it in my overview 2014-4 the last row of

I just cant get it to work any help will be great :)
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this...

Code:
[color=darkblue]If[/color] Sheets("Counting").Range(i, "R").Value = Sheets("Overview 2014-4").Range("Q1").Value [color=darkblue]Then[/color]
    Sheets("Counting").[B]Rows(i).Range("S1:W1")[/B].Copy Destination:=Sheets("Overview 2014-4").Cells(Rows.Count, "Q").End(xlUp).Offset(1, 0)
End [color=darkblue]If[/color]
 
Upvote 0
Hey AlphaFrog

Sorry for the late feedback, i triede your code, and it gives me the error message 1004, "Application-Defined or object-defined error" in the first line of code.

Thx for the help so far :)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

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