Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Marco to copy and paste column as well as edit link

A macro to copy and paste column as well as replace the formula/link in those
cells

For example:
I want to copy column A to column B with all the same format however with
different link in the cells.

Column A, all cells is link to Q:\ PPE20081202, so when I hit the Marco it
will copy the entire format to column B but the link will change from Q:\
PPE20081202 to Q:\ PPE20081216

P.S
20081216 is 2008-12-16 (Date)

Thank you very much

Best regards,

Harn

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Marco to copy and paste column as well as edit link

try this
Sub test()
Dim rng As Range
Dim Cell As Range
Dim strNewVal, strDate As String

Set rng = Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp))
strDate = Format(Date, "yyyymmdd")
For Each Cell In rng
strNewVal = Replace(Cell.Value, Right(Cell.Value, 8), strDate)
Cell.Offset(, 1).Value = Cell.Value
Next Cell
rng.ClearContents
End Sub

"Harn88" wrote:

A macro to copy and paste column as well as replace the formula/link in those
cells

For example:
I want to copy column A to column B with all the same format however with
different link in the cells.

Column A, all cells is link to Q:\ PPE20081202, so when I hit the Marco it
will copy the entire format to column B but the link will change from Q:\
PPE20081202 to Q:\ PPE20081216

P.S
20081216 is 2008-12-16 (Date)

Thank you very much

Best regards,

Harn

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Marco to copy and paste column as well as edit link

Replace this line Cell.Offset(, 1).Value = Cell.Value with the one below
Cell.Offset(, 1).Value = strNewVal

"Harn88" wrote:

A macro to copy and paste column as well as replace the formula/link in those
cells

For example:
I want to copy column A to column B with all the same format however with
different link in the cells.

Column A, all cells is link to Q:\ PPE20081202, so when I hit the Marco it
will copy the entire format to column B but the link will change from Q:\
PPE20081202 to Q:\ PPE20081216

P.S
20081216 is 2008-12-16 (Date)

Thank you very much

Best regards,

Harn

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 to copy, edit then paste a macro. Romileyrunner1 Excel Worksheet Functions 1 September 8th 09 10:58 PM
Macro for Edit/Copy/Paste Special icanlearn Excel Worksheet Functions 4 July 17th 08 06:54 PM
how to disable copy paste buttons from from edit menu excel test Excel Discussion (Misc queries) 2 January 18th 07 05:00 PM
Marco to copy from active cell to top of column Balthasar G Excel Programming 1 August 9th 06 01:25 PM
How do I edit, copy and paste text in excel cells? floridactyl New Users to Excel 2 December 31st 04 03:52 PM


All times are GMT +1. The time now is 04:20 AM.

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"