Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-13-2019, 10:08 PM
FrancisSIP FrancisSIP is offline VBA data transfer to continue on next empty row (Excel 2013) Windows 8 VBA data transfer to continue on next empty row (Excel 2013) Office 2013
Novice
VBA data transfer to continue on next empty row (Excel 2013)
 
Join Date: Apr 2019
Posts: 5
FrancisSIP is on a distinguished road
Unhappy Macros were working but now aren't

So, the macros were working fine. However, a few hours later, when executing the macros, it runs but no result shows up as per before nor an error message.



I've searched online to find the source of the issue - whether it was a scripting problem or a software setting problem or bug. Hope I could get another helping hand!

The macros are below (I've edited them a bit).:

Code:
Sub FullBTExport()
'
' FullBTExport Macro
' Extracts all items with values from each schedule into one takeoff sheet for export.
    
    Range("2:100").Clear 'Erases all existing values from rows 1 to 100.

    Dim sourcesheet As Worksheet
    Dim i As Long, j As Long
    
    j = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
    
    For Each sourcesheet In ThisWorkbook.Sheets
        If sourcesheet.Name <> ActiveSheet.Name Then
            With sourcesheet
                For i = 6 To .Cells(Rows.Count, 3).End(xlUp).Row
                    If .Cells(i, 4) <> "" Then
                        ActiveSheet.Cells(j, 1).Value = .Cells(i, 1).Value
                        ActiveSheet.Cells(j, 2).Resize(, 6).Value = .Cells(i, 2).Resize(, 6).Value
                        j = j + 1
                    End If
                Next i
            End With
        End If
    Next sourcesheet
End Sub

Sub ExportCSV()
'
' ExportCSV Macro
'

Dim wbkExport As Workbook
Dim shtToExport As Worksheet

Set shtToExport = ThisWorkbook.Worksheets("BUILDER TREND ITEMS")     'Sheet to export as CSV
Set wbkExport = Application.Workbooks.Add
shtToExport.Copy Before:=wbkExport.Worksheets(wbkExport.Worksheets.Count)
Application.DisplayAlerts = True                       'Possibly overwrite without asking
wbkExport.SaveAs Filename:="BT EXPORT" + " " + Format(Date, "dd-mm-yyyy"), FileFormat:=xlCSV
Application.DisplayAlerts = True
wbkExport.Close SaveChanges:=True

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer data from list with multiple headings from word to excel psohms Word 1 06-11-2015 04:39 PM
VBA data transfer to continue on next empty row (Excel 2013) Data Transfer From Excel spc94 Word VBA 1 06-03-2015 09:56 PM
Transfer Data between Excel and Word s_samira_21 Excel 0 01-19-2015 05:21 AM
Data transfer from Word tables to Excel shoro Word 4 10-01-2013 05:08 AM
VBA data transfer to continue on next empty row (Excel 2013) Is it possilble to transfer data from Excel to Publisher? markhuges Publisher 8 10-23-2011 05:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft