Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Altered pasting functionality

Hi JJ,

Am Fri, 25 Jan 2013 02:40:32 -0800 (PST) schrieb JJ:

Thanks Claus, your code is working on the exact example I stated above. But if I for example have "1" in C2 and "2" in C3 and I want to copy C2, select C3 and run the macro, it doesn't work.
Also - is it possible to use a solution without formating? I want the "/"-sign to be real.


then try (modify the columns to suit):

Sub Test()
Dim LRow As Long
Dim rngC As Range

LRow = Cells(Rows.Count, "B").End(xlUp).Row
Range("B1:B" & LRow).NumberFormat = "@"
For Each rngC In Range("B1:B" & LRow)
If rngC < "" And rngC.Offset(0, -1) = "" Then
rngC = rngC
ElseIf rngC = "" And rngC.Offset(0, -1) < "" Then
rngC = rngC.Offset(0, -1)
ElseIf rngC = "" And rngC.Offset(0, -1) = "" Then
rngC = ""
Else
rngC = rngC.Offset(0, -1) & "/" & rngC
End If
Next
End Sub

You have not to select cells. The code runs for Column A and Column B
and all the data that is in these columns.


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Altered Column Width No Name Excel Discussion (Misc queries) 2 May 4th 07 06:08 PM
Altered Column Width No Name New Users to Excel 2 May 4th 07 06:08 PM
Altered Column Width No Name Excel Worksheet Functions 2 May 4th 07 06:08 PM
Altered Column Width No Name Excel Programming 2 May 4th 07 06:08 PM
highlighting altered cells questionables Excel Discussion (Misc queries) 0 December 11th 06 10:41 PM


All times are GMT +1. The time now is 11:08 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"