LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default moving columns

Hello, there was a previously posted solution that worked great for moving
the value of one column to another column if certain criteria were met. The
code below analyzes column G, and if the cell in the same row in column C is
blank, then the value from column G is entered into that cell in column C.

Option Explicit
Sub Fillblanks()
Dim myRng As Range
Dim myCell As Range

With Activesheet
Set myRng = .Range("G1", .Cells(.Rows.Count, "G").End(xlUp))

For Each myCell In myRng.Cells
If .Cells(myCell.Row, "C").Value = "" Then
.Cells(myCell.Row, "C").Value = myCell.Value
myCell.Value = ""
End If
Next myCell
End With
End Sub

The result that I need is this:
Analyze column G and C the same way, and if the two values are equal to each
other, then move the values from column G and H ( I have two columns that are
associated with each other) to columns D and E. Would it also be possible to
analyze columns C and G, and move the values from G and H to wherever the
matching C values are, regardless if they are in the same row or not?

Thanks.
Dino

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving columns with formulas gives #REF! Miss Kitty[_2_] Excel Worksheet Functions 0 August 20th 08 03:12 PM
Moving Columns egrave Excel Discussion (Misc queries) 1 July 6th 08 11:09 PM
Moving columns about green biro Excel Programming 1 October 30th 07 10:54 PM
Moving Columns only hyyfte[_16_] Excel Programming 0 September 22nd 04 04:03 PM
Moving Columns gminor7 Excel Programming 2 September 12th 03 03:27 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"