Hi,
I am a novice in excel macro programming, and new to this forum. I need a help in developing a Macro - VB script for the following scenario.
I have 3 columns, Column A, Column B and Column C.
I want macro to check contents of Column B and wherever there is a blank, macro should copy correspoding content in Column A to Column C. Column C shouldn't have any blanks.
Ex:
Column A Column B Column C
abc 123 efg
cde 234 ijk
efg
ghi 456
ijk
klm 678
Any help will be much appreciated. Thanks in advance.
Hi Venkat89, I don't know if this is the fix but it is a start. TryOption Explicit Sub CopyFromBlanks() Dim oCell As Range Dim Ws1 As Worksheet Set Ws1 = Worksheets("Sheet1") For Each oCell In Ws1.Range(Ws1.Cells(1, 1), Ws1.Cells(Rows.Count, 1).End(xlUp)) If oCell.Offset(0, 1).Value = "" Then oCell.Offset(0, 2).Value = oCell.Value Next oCell End Sub
Please leave a message after the beep!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks