Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy contents if.......


I am looking for a way to do the following:

If ("d1:d999") = "text in the cell" then copy ("e1:e999") to
("f1:f999")

In other words I have a standard text like "tax" in d3, d18, d44, etc.
If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18,
f44.

If this possible?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=513359

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Copy contents if.......

Hi,

Sub CopyEtoF()
mytext = "Whatever you want"
For i = 1 To 999
If Cells(i, "D") = mytext Then Cells(i, "F") = Cells(i, "E")
Next i
End Sub

"Metrazal" wrote:


I am looking for a way to do the following:

If ("d1:d999") = "text in the cell" then copy ("e1:e999") to
("f1:f999")

In other words I have a standard text like "tax" in d3, d18, d44, etc.
If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18,
f44.

If this possible?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile: http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=513359


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copy contents if.......

Sub copydata()
Dim cell as Range
for each cell in Range("d1:d999")
if instr(1,cell.Value,"tax",vbTextCompare) then
cell.offset(0,1).copy cell.offset(0,2)
end if
Next
End Sub

--
Regards,
Tom Ogilvy

"Metrazal" wrote in
message ...

I am looking for a way to do the following:

If ("d1:d999") = "text in the cell" then copy ("e1:e999") to
("f1:f999")

In other words I have a standard text like "tax" in d3, d18, d44, etc.
If this text exsists then I want to copy e3, e18, e44, etc. to f3, f18,
f44.

If this possible?

Thanks,

Met


--
Metrazal
------------------------------------------------------------------------
Metrazal's Profile:

http://www.excelforum.com/member.php...o&userid=31648
View this thread: http://www.excelforum.com/showthread...hreadid=513359



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
Copy contents from one cell to another Don[_4_] New Users to Excel 0 September 25th 09 04:18 PM
Copy cell contents with VB TheMilkGuy Excel Discussion (Misc queries) 6 July 21st 09 11:46 PM
Copy contents to another page Richard Excel Worksheet Functions 2 March 24th 08 01:08 AM
copy cell value not contents D Moran Excel Discussion (Misc queries) 2 April 24th 06 03:29 PM
Copy Contents of 3 Columns into 1 Lynxen Excel Programming 4 July 13th 05 01:19 PM


All times are GMT +1. The time now is 12:47 PM.

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"