To show blank record when no data while copying
Solved/Closed
AK
-
Apr 18, 2014 at 03:19 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 22, 2014 at 12:37 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 22, 2014 at 12:37 AM
Related:
- To show blank record when no data while copying
- Messenger voice record downloader - Guide
- How to send voice record in messenger - Guide
- Tmobile data check - Guide
- Audacity listen while recording - Guide
- Transfer data from one excel worksheet to another automatically - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Apr 19, 2014 at 08:20 AM
Apr 19, 2014 at 08:20 AM
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 June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Apr 22, 2014 at 12:37 AM
Apr 22, 2014 at 12:37 AM
send the file through
speedyshare.com
speedyshare.com
Apr 21, 2014 at 10:04 AM
Thanks again for your help