To show blank record when no data while copying
Solved/Closed
AK
-
18 Apr 2014 à 15:19
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 22 Apr 2014 à 00:37
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 22 Apr 2014 à 00:37
Related:
- Blank data
- How to copy data from one excel sheet to another - Guide
- Tmobile data check - Guide
- Blancco data cleaner - Download - Cleaning and optimization
- Data backup software - Guide
- How to export data from facebook - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
19 Apr 2014 à 08:20
19 Apr 2014 à 08:20
I have slightly tweaked your macro and called the new macro as "test"
the code in this macro
copied only if there is more data than headers
the macro test is
the code in this macro
If r.Rows.Count > 1 Then
copied only if there is more data than headers
the macro test is
Sub test()
Dim r As Range, sh(1 To 2) As String, j As Integer
sh(1) = "active"
sh(2) = "inactive"
For j = 1 To 2
With Worksheets(sh(j))
Set r = Range(.Cells(4, 2), .Cells(Cells(Rows.Count, "B").End(xlUp).Row, 13))
'MsgBox r.Address
If r.Rows.Count > 1 Then
r.Copy
End If
With Worksheets("total position")
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
End With
Next j
MsgBox "macro done"
End Sub
Venkat ,
I checked running with Data ,it is only picking up the first record from both the sheets .I need that it should pick up all data from two sheets and if there is no data then no header display.
Can you please have a look .
Ak
I checked running with Data ,it is only picking up the first record from both the sheets .I need that it should pick up all data from two sheets and if there is no data then no header display.
Can you please have a look .
Ak
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
22 Apr 2014 à 00:37
22 Apr 2014 à 00:37
send the file through
speedyshare.com
speedyshare.com
21 Apr 2014 à 10:04
Thanks again for your help