
Howard Cohen
Member
Members

Forum Posts: 56
Member Since:
December 8, 2016
December 8, 2016

I have a file that I want to import the data that have been coloured using Conditional formatting
I have code to open a file, but need this amended to only copy the data that has been coloured containing conditional formatting
Your assistance in resolving this is most appreciated
Sub Open_and_CopyFile() ' Application.ScreenUpdating = False Application.EnableEvents = False Application.Calculation = xlCalculationManual Application.DisplayAlerts = False Dim nb As Workbook, ts As Worksheet, A As Variant Dim rngDestination As Range Sheets(1).Select Set ts = ActiveSheet On Error Resume Next Set rngDestination = ts.[A1] On Error GoTo 0 If rngDestination Is Nothing Then Exit Sub ChDir ("C:\my Documents") With Application.FileDialog(msoFileDialogFilePicker) .InitialFileName = "*Conditional*.xls*" If .Show = 0 Then Exit Sub A = .SelectedItems(1) End With ' A = Application.GetOpenFilename ' If A = False Or IsEmpty(A) Then Exit Sub Application.ScreenUpdating = False Set nb = Workbooks.Open(A) ThisWorkbook.Activate nb.Sheets(1).Range("A3:D50").Copy rngDestination.PasteSpecial Paste:=xlPasteValues rngDestination.PasteSpecial Paste:=xlPasteFormats Application.CutCopyMode = False nb.Close savechanges:=False Application.ScreenUpdating = True Application.EnableEvents = True Application.Calculation = xlCalculationAutomatic Application.DisplayAlerts = False End SubI have also posted on Macro to import data containing Conditional formatting (excelforum.com)
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Martin Delloca, Tracy English
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 183
Newest Members:
Rob Rooth
Tom Lewis
Jennifer Rodriguez-Avila
Khaled Ibrahim
Kiran Supekar
Lisa Myers
Ronald White
Ginette Guevremont
Taryn Ambrosi
Mark Davenport
Forum Stats:
Groups: 3
Forums: 24
Topics: 6531
Posts: 28604
Member Stats:
Guest Posters: 49
Members: 32822
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —
