if / copy in a macro

mani_singh

Well-known Member
Joined
Jul 24, 2007
Messages
583
what i need is to be able to do this:


if b1 is less than c1 then copy a1,d1,e1,f1,g1


thank you, im not sure how to do this :confused:
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
COPY WHERE

try this small macro

Code:
Sub test()
If Range("b1") < Range("c1") Then Union(Range("a1"), Range("d1:g1")).Copy Range("a4")
End Sub
Code:
 
Upvote 0
ok let me try again. sorry

i have reference data in cell

m9 the macro needs to check cell N9, if its more than m9 then copy cells o9,p9,q9,r9 and s9 to cell a4,b4,c4,d4 and e4 respectivly on a sheet called "shift left abuse"

finally the macro neesds to go back to the1st page "shift left data" and drop to m10 and run the copy command again unitll the data on 1st page runs out.

thanks venkat!
 
Upvote 0

Forum statistics

Threads
1,214,628
Messages
6,120,618
Members
448,973
Latest member
ChristineC

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