Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2017, 02:58 PM
FUGMAN FUGMAN is offline deleting blanks and commas Windows 10 deleting blanks and commas Office 2016
Banned
deleting blanks and commas
 
Join Date: Feb 2017
Posts: 55
FUGMAN is on a distinguished road
Default

A B C
FACILITY ZIP CODE STATE
AAAAAAA 111111 ?? ROW 7
BBBBBB 22222 ?? ROW 8
CCCCCC 333333 KY ROW 9
EEEEE 555555 MI ROW 10
DDDDDD 444444 AK ROW 11

Sub Remove_Dupes()
'ActiveSheet.Unprotect
' Remove_Dupes Macro

Dim lr As Long, r As Long, wr As Long
Application.ScreenUpdating = False
'row to write to
wr = Sheets("dupesheet").Cells(Rows.Count, 1).End(xlUp).Row + 1
'rows to check for dupes
With Sheets("FACILITY RECORDS")
'last row
lr = .Cells(Rows.Count, "A").End(xlUp).Row
'start at bottom row and work up


For r = lr To 2 Step -1
If .Cells(r, 1) = .Cells(r - 1, 1) Then
'compare the two rows
' credit Tim Williams ~~~ with great explanation at
' http://stackoverflow.com/questions/1...ows-in-a-sheet
If Join(Application.Transpose(Application.Transpose(. Cells(r, 1).EntireRow.Value)), "") = _
Join(Application.Transpose(Application.Transpose(. Cells(r - 1, 1).EntireRow.Value)), "") Then
'copy and delete if equal
.Cells(r, 1).EntireRow.Copy Sheets("dupesheet").Cells(wr, 1)
.Cells(r, 1).EntireRow.Delete
wr = wr + 1
End If
End If
Next r
End With
Application.ScreenUpdating = True
ActiveSheet.Protect
'
End Sub

I get the error even with this small sample. Wondering if my excel software is wacked out
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
pivot not showing number format with commas olybobo Excel 1 05-05-2016 05:09 PM
deleting blanks and commas Counting Blanks in 1 Column and Non-Blanks in Another dogwood705 Excel 4 02-07-2015 08:45 AM
Commas within fields in .csv files gar Excel 1 01-29-2015 09:24 PM
deleting blanks and commas How to use mid or left functions to seperate city,st,zip with no commas sinaranje Excel 4 11-11-2014 10:52 PM
deleting blanks and commas No inverted commas in word 2013. tonycrossley Word 3 01-27-2014 04:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft