Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2011, 10:49 AM
Catalin.B Catalin.B is offline Move data from 1 cell to another cell Windows Vista Move data from 1 cell to another cell Office 2007
Expert
Move data from 1 cell to another cell
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default Move data from 1 cell to another cell

Hello again,
I am facing another interesting chalange, to move text from a worksheet containing different sets of text to another worksheet in the same workbook. I attach a sample workbook with details. Again, time is not my best friend


I have to create a huge number of projects based on this operations.
If you can ease my research with a starting clue, it will be a great help.
Attached Files
File Type: xlsx test.xlsx (11.6 KB, 22 views)
Reply With Quote
  #2  
Old 06-25-2011, 12:51 PM
Catalin.B Catalin.B is offline Move data from 1 cell to another cell Windows Vista Move data from 1 cell to another cell Office 2007
Expert
Move data from 1 cell to another cell
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Well, i did find a solution....
Looks Like this:

Sub NextAll()
Dim col As Range, row As Range, Myrange As Range
Set col = Worksheets("Foaie1").Range("J3")

If Worksheets("Foaie1").Range("J3") = 10 Then
Worksheets("Foaie2").Range("A3:A6").Copy
Worksheets("Foaie1").Range("A3").PasteSpecial (xlPasteValues)
Exit Sub
End If
Set Myrange = Range(Worksheets("Foaie2").Cells(3, col), Worksheets("Foaie2").Cells(6, col))
Myrange.Copy
Worksheets("Foaie1").Range("A3").PasteSpecial (xlPasteValues)

On Error GoTo 0
End Sub

This macro depends on evaluation formula in cell "J3", which is:
=IF(ISERROR(MATCH(A3;Foaie2!A3:I3;0)+1)=TRUE;0;MAT CH(A3;Foaie2!A3:I3;0)+1)
To copy row by row instead of a range of rows, just change the copy range to 1 row
I am sure there are better solutions... but this works fine for me, so I will give many thanks to me
I will atach the file again for those interested.
Have a great day
Attached Files
File Type: xlsm test.xlsm (21.3 KB, 12 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Move data from 1 cell to another cell How to combine different cells data in one cell? Learner7 Excel 1 07-28-2010 12:07 PM
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM
How can I make a cell color RED under the Today's date cell? Learner7 Excel 2 07-08-2010 12:52 AM
Move data from 1 cell to another cell Copying data from one cell to another automatically mrphilk Excel 4 06-10-2010 11:52 PM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft