Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default If Cell in row has data then do this: HELP

If column I has data in it I want Excel to perform the following.

1. Concatanate the data in the coresponding row column G to the end of the
data in the coresponding row in column F

2. Move the data from column I to the coresponding cell in the same row in
column G


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default If Cell in row has data then do this: HELP

Slipping and sliding....

Sub ChutesAndLadders()
Dim shtCurrent As Worksheet
Set shtCurrent = ActiveSheet
Dim rngColumnI As Range
Set rngColumnI = shtCurrent.Range("I1", "I65000")
Dim intTotalRows As Integer
intTotalRows = shtCurrent.UsedRange.Rows.Count
Dim rngRow As Range
For Each rngRow In rngColumnI
If rngRow.Row intTotalRows Then Exit For
If Not IsEmpty(rngRow.Value) Then
With rngRow
.Offset(0, -3).Value = .Offset(0, -
3).Value & .Offset(0, -2).Value
.Offset(0, -2).Value = rngRow.Value
.Value = ""
End With
End If
Next
End Sub

If I understood you right, that will do it!

-Brad
-----Original Message-----
If column I has data in it I want Excel to perform the

following.

1. Concatanate the data in the coresponding row column G

to the end of the
data in the coresponding row in column F

2. Move the data from column I to the coresponding cell

in the same row in
column G


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If Cell in row has data then do this: HELP

Dim rng as Range, cell as Range
set rng = Range(Cells(1,"I"),Cells(rows.count,"I").End(xlup)
for each cell in rng
if not isempty(cell) then
cells(rng.row,"F").Value = cells(rng.row,"F").Value _
& cels(rng.row,"G").Value
cells(rng.row,"G").Value = cell
cell.Clearcontents
end if
Next

This would replace a formula if it is in one of the cells being manipulated,
so the assumption is that the cells do not contain formulas.

--
Regards,
Tom Ogilvy


"Yogi_Bear_79" wrote in message
...
If column I has data in it I want Excel to perform the following.

1. Concatanate the data in the coresponding row column G to the end of the
data in the coresponding row in column F

2. Move the data from column I to the coresponding cell in the same row in
column G




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default If Cell in row has data then do this: HELP

Code doesn't seemto be working;
At first I thought it was working, then I noticed all it was doing was
clearing the contents of the cells in column I

When I comment out these two lines nothing happens at all:

cells(rng.row,"G").Value = cell
cell.Clearcontents

Now I fI understood the code corrctly, editing out those two lines should
still allow F&G to concatanate. Which they are currently not


"Tom Ogilvy" wrote in message
...
Dim rng as Range, cell as Range
set rng = Range(Cells(1,"I"),Cells(rows.count,"I").End(xlup)
for each cell in rng
if not isempty(cell) then
cells(rng.row,"F").Value = cells(rng.row,"F").Value _
& cels(rng.row,"G").Value
cells(rng.row,"G").Value = cell
cell.Clearcontents
end if
Next

This would replace a formula if it is in one of the cells being

manipulated,
so the assumption is that the cells do not contain formulas.

--
Regards,
Tom Ogilvy


"Yogi_Bear_79" wrote in message
...
If column I has data in it I want Excel to perform the following.

1. Concatanate the data in the coresponding row column G to the end of

the
data in the coresponding row in column F

2. Move the data from column I to the coresponding cell in the same row

in
column G






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default If Cell in row has data then do this: HELP

Actually,

I've found that it does work sort of:
It concatanates only F1&G1. Funny thing is it does it for as many cells in
column I that do have data so as an example:

F1 = Hello
G1 = World

Column I has 4 cells that contain data
nowF1 = Hello World World World World

"Tom Ogilvy" wrote in message
...
Dim rng as Range, cell as Range
set rng = Range(Cells(1,"I"),Cells(rows.count,"I").End(xlup)
for each cell in rng
if not isempty(cell) then
cells(rng.row,"F").Value = cells(rng.row,"F").Value _
& cels(rng.row,"G").Value
cells(rng.row,"G").Value = cell
cell.Clearcontents
end if
Next

This would replace a formula if it is in one of the cells being

manipulated,
so the assumption is that the cells do not contain formulas.

--
Regards,
Tom Ogilvy


"Yogi_Bear_79" wrote in message
...
If column I has data in it I want Excel to perform the following.

1. Concatanate the data in the coresponding row column G to the end of

the
data in the coresponding row in column F

2. Move the data from column I to the coresponding cell in the same row

in
column G






Reply
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
how do i find specific data in a cell and its colocated cell data sfself Excel Worksheet Functions 4 March 27th 09 08:23 AM
converting numerical data in one cell to word data in another cell Vishnu Excel Worksheet Functions 2 June 4th 08 03:14 PM
how to find number in a cell , a cell contains character data ornumeric data [email protected] Excel Worksheet Functions 3 February 19th 08 07:29 PM
moving data to a cell, not pulling data to the cell Yojinbou Excel Worksheet Functions 2 November 27th 06 07:32 PM
Find MAX data in sheet (Cell) - Any cell that exceeds X amount of data confuzedagain Excel Discussion (Misc queries) 1 December 7th 05 05:56 PM


All times are GMT +1. The time now is 07:48 PM.

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

About Us

"It's about Microsoft Excel"