Help please with a simple copy and paste macro

EagerToLearn

New Member
Joined
Jan 20, 2011
Messages
20
Hello there,
If some could please help with a simple macro.
I have workbook contains of several sheets.
I want to copy and paste form one sheet to the other.
Based if one column have no value or not, I want to bring that value to the other sheet and other data form the same row as well and past it on the other sheet in certain cells
I have sample file i can send
What is shows is copying form one sheet to create a journal entry to the second sheet.
If there is a value under column B, then take value under column B, C, D, A and past it in ceatain cells on the other sheet.
If there is not value under column B, then preceed with the following row.
Creating this journal entry manully is so much work, I hope someone can direct me on how to wirte this code.
Help is greatly appreciated.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
try a macro like this

Code:
Sub test()
Dim r As Range, filt As Range
With Worksheets("sheet1")
Set r = .Range("a1").CurrentRegion
r.AutoFilter Field:=2, Criteria1:="<>"

Set filt = r.Offset(1, 0).Resize(r.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
filt.Copy Worksheets("sheet2").Range("A1")
r.AutoFilter
End With


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,201
Members
449,214
Latest member
mr_ordinaryboy

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