LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Beginner: Compare cells, if they have same value, then copy the ro

Hi,

I am newbie to VBA, and need help to accomplish:

In a sheet I need to compare the cells in row E (row E is sorted
alphabetically), to see if they have the same value. It can be up to 10 rows
with the same value. (the whole sheet contains <1500 rows)

If they are the same, those rows with samy value in column E shall be copied
to another sheet.
This is just a part of the makros that are running.

As said, I am a newbie, but does this do something?
(Earlier in the makro there is
Dim x
x = 1)

Sheets("Skatteseddel").Select

Dim k
k = 1

If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1
If Range("E" & x) = ("E" & "x + k") Then k = k + 1

Sheets("Skatteseddel").Select
Rows(x,x+k).Select
Selection.Copy

Can someone please help?

--
Regards,
Steffen
--
Regards,
Steffen
 
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
Compare cells and copy columns after match Kcope8302 Excel Worksheet Functions 2 August 5th 09 05:37 PM
compare cells, copy, loop Immortal_Creations Excel Worksheet Functions 2 July 17th 09 03:34 PM
compare 2 cells then copy value if they are different Gwen B Excel Discussion (Misc queries) 3 May 15th 09 05:44 PM
compare value in cell and copy cells A through S of same row to a new worksheet johnnyray00 Excel Programming 1 November 13th 03 03:56 PM
If match then copy.. beginner in VBA Charlene[_2_] Excel Programming 0 August 13th 03 05:17 PM


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