Solved Coping Data from one cell to another cell

October 13, 2017 at 10:20:13
Specs: window7
I am working in excel 10 and I have a spreadsheet Column A has generic information and blanks. Column B has names and spaces that needs to replace the column a.

Column A1 has "Service Account" and it needs to be changed to information in column B "Hennery Clay". We only need to changes the ones in column A that has 'Service Account"

See More: Coping Data from one cell to another cell

October 13, 2017 at 11:50:53
✔ Best Answer
There are a couple of ways to accomplish your goal. One uses a Helper Column with a formula, the other uses a macro.

Method 1:

1 - Pick any empty column e.g. D as a Helper Column and enter this in D1:

=IF(A1="Service Account",B1,A1)

2 - Drag this down as far as you need to

3 - Right click the top of Column D and choose Copy

4 - Right click the top of Column A and click the 123 icon to paste the values returned by the formula into Column A.

5 - Delete the data in Column D

Method 2:

Run this code:

Sub BtoA()
 With Columns(1)
  Set c = .Find("Service Account")
   If Not c Is Nothing Then
    firstAddress = c.Address
      c.Value = c.Offset(0, 1)
       Set c = .FindNext(c)
        If c Is Nothing Then Exit Do
     Loop Until c.Address = firstAddress
   End If
 End With
End Sub

How To Post Data or Code ---> Click Here Before Posting Data or VBA Code

Report •

October 20, 2017 at 11:12:35
Thanks for your help

Report •
Related Solutions

Ask Question