To show blank record when no data while copying
Solved/Closed
AK
-
Apr 18, 2014 at 03:19 PM
venkat1926 Posts 1864 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 22, 2014 at 12:37 AM
venkat1926 Posts 1864 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
- Transfer data from one excel worksheet to another automatically - Guide
- Digital data transmission - Guide
- Audacity listen while recording - Guide
- How to be offline in whatsapp when data is on - Guide
- Download tiktok data after ban - Guide
3 replies
venkat1926
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
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
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
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