I'm in need of a macro that will move data from a group of cells in a column to a different group of cells if the information is empty. Is there a macro out there like that?
I have to pull information from a database on a daily basis. The information is sometimes placed into the wrong area on the data entry end of the database. When I transfer the data into an Excel spreadsheet I have to sometimes move information over from one column to the proper column.
To give an example I have a column A that tends to sometimes have the information that I need in Column B. When dealing with a large report I need to shorten the time that it takes to sort everything out.
I guess my main goal is this...If Column B is empty but Column A has data in it...I want to have a macro that will move the information over to Column B. But I only need this to be done if Column B is Empty.
Sub CopyData()
Dim r As Range
Dim myCell As Range
Set r = Range("A1", Range("A" & Rows.Count).End(xlUp))
For Each myCell In r
If myCell.Value <> "" And myCell.Offset(0, 1).Value = "" Then
myCell.Offset(0, 1) = myCell
End If
Next myCell
End Sub
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.