#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Copy value

On Nov 7, 11:38*am, Don Guillett wrote:
Should do it. You don't need to put anything in the column to the
left. Excel will do it.

Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2 'if column B
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub


===

It didn't work.

I re-posted on: microsoft.public.excel.programming

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Copy value

On Nov 7, 1:56*pm, gary wrote:
On Nov 7, 11:38*am, Don Guillett wrote:

Should do it. You don't need to put anything in the column to the
left. Excel will do it.


Sub copynumbersif()
Dim mc As Long
Dim i As Long
mc = 2 'if column B
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i - 1, mc) = Cells(i, mc) Then
Cells(i - 1, mc - 1) = Cells(i, mc)
Cells(i, mc - 1) = Cells(i, mc)
End If
Next i
End Sub


===

It didn't work.

I re-posted on: microsoft.public.excel.programming


What does " it didn't work" mean. I tested. All you had to do was
change
mc = 2 to whatever column you are testing.
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 can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
I copy a formula and the results copy from the original cell brooklynsd Excel Discussion (Misc queries) 1 June 23rd 07 01:35 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM


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