Can I hel me to modify this scritp to copy only not empty rows in a new worksheet ?
Sub Export_Basecosti()
Dim fd As Office.FileDialog
Dim fn As String
Dim FilePath, FileOnly, PathOnly As String
Dim ur As Long
FileOnly = ThisWorkbook.Name
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
.Title = "Scegli il file della Base Costi da Compilare"
.Filters.Clear
.Filters.Add "All Files", "*.*"
If .Show = True Then
fn = Empty
fn = Dir(fd.SelectedItems(1))
End If
End With
Windows(FileOnly).Activate
Sheets("Base Costi").Select
ur = Worksheets("Base Costi").Cells(Rows.Count, "C").End(xlUp).Row
MsgBox ur
'Copy A Range of Data
Worksheets("Base Costi").Rows("2:" & ur).Copy
' Rows("2:252").Select
' Selection.Copy
' Selection.SpecialCells(xlCellTypeVisible).Copy
Workbooks.Open (fn)
Sheets("Bid COSTS - Link").Select
'Clear
Sheets("Bid COSTS - Link").Rows("8:508").ClearContents
' Range("A8").Select
' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Bid COSTS - Link").Range("A8").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
' ActiveWorkbook.CheckCompatibility = False
' ActiveWorkbook.Save
'Dim ws As Worksheet
'Set ws = ThisWorkbook.Sheets("Bid COSTS - Link")
'ws.Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Workbooks(fn).Save
Workbooks(fn).Close
MsgBox "Base Costi Copiata"
End Sub
i have tried to modify the code, but don't work..