dannyok90
Board Regular
- Joined
- Aug 30, 2016
- Messages
- 115
Hi,
This code is to send data to another spreadsheet and its not returning any bugs but it just isnt sending the data?
can anybody sot something im missing or just not seeing
-Excel for Mac
Thanks!
This code is to send data to another spreadsheet and its not returning any bugs but it just isnt sending the data?
can anybody sot something im missing or just not seeing
-Excel for Mac
Thanks!
Code:
[COLOR=#011993][FONT=Menlo]Sub[/FONT][/COLOR][COLOR=#000000][FONT=Menlo] Workbook1()[/FONT][/COLOR][COLOR=#011993][FONT=Menlo]Dim[COLOR=#000000] LastRow [/COLOR]AsInteger[COLOR=#000000], i [/COLOR]AsInteger[COLOR=#000000], erow [/COLOR]AsInteger[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo][COLOR=#011993]For[/COLOR] i = 2 [COLOR=#011993]To[/COLOR] LastRow[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo][COLOR=#011993]If[/COLOR] Cells(i, 1) = Date [COLOR=#011993]And[/COLOR] Cells(i, 2) = “Sales” [COLOR=#011993]Then[/COLOR][/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]Range(Cells(i, 1), Cells(i, 7)).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]Selection.Copy[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]Workbooks.Open Filename:=(” / Users / danielokeefe / Desktop / master.xlsx”)[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]Worksheets(“Sheet1”).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]erow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]ActiveSheet.Cells(erow, 1).Select[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]ActiveSheet.Paste[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]ActiveWorkbook.Save[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]ActiveWorkbook.Close[/FONT][/COLOR]
[COLOR=#000000][FONT=Menlo]Application.CutCopyMode = [COLOR=#011993]False[/COLOR][/FONT][/COLOR]
[COLOR=#011993][FONT=Menlo]EndIf[/FONT][/COLOR]
[COLOR=#011993][FONT=Menlo]Next[COLOR=#000000] i[/COLOR][/FONT][/COLOR]
[COLOR=#011993][FONT=Menlo]End[/FONT][/COLOR][COLOR=#011993][FONT=Menlo]Sub
[/FONT][/COLOR]