RE: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
Attached Your file.. From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Jorge Marques Sent: Monday, July 25, 2011 8:47 PM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error Doing that, it doesn´t return the error anymore, but the macro still doesn´t copy the information :s, is it any complication with excel 2010? 2011/7/22 Rajan_Verma Set Wb=ActiveWorkbook From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Jorge Marques Sent: Thursday, July 21, 2011 10:44 PM To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error Hi guys, i have this macro i use to copy a range from column D of a worksheet of a workbook to column G of another workbook and worksheet, but it keeps giving me the same error saying that it´s "subscript out of range" in the line in yellow. Public wb, wbmes As Workbook Sub filldatabase() Call AbrirFile Call left wbmes.Close End Sub Private Sub AbrirFile() Dim Filter, Caption As String Dim SelectedFile As Variant Set wb = ThisWorkbook Filter = "Ficheiro XLS (*.xls),(*.xls)" Caption = "Escolha o ficheiro a importar..." SelectedFile = Application.GetOpenFilename(Filter, , Caption) If SelectedFile = False Then Exit Sub Set wbmes = Workbooks.Open(SelectedFile, 1, 1) End Sub Private Sub left() Dim a As Double wbmes.Activate wbmes.Sheets("Total_Refrige").Select wbmes.Sheets("Total_Refrige").Range(Range("D2"), Range("D2").End(xlDown)).Copy wb.Activate If wb.Sheets("Pivot").Range("G2").Value <> "" Then wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select Else wb.Sheets("Pivot").Range("G2").Select End If a = ActiveCell.Row wb.Sheets("Total Refrige").Paste Application.CutCopyMode = False i = a While wb.Sheets("Pivot").Range("G" & i).Value <> "" i = i + 1 Wend End Sub Do you have any idea how to solve this?1000 thanks -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com <http://www.excel-macros.blogspot.com/> 4. Learn VBA Macros at http://www.quickvba.blogspot.com <http://www.quickvba.blogspot.com/> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com <http://exceldailytip.blogspot.com/> To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com <http://www.excel-macros.blogspot.com/> 4. Learn VBA Macros at http://www.quickvba.blogspot.com <http://www.quickvba.blogspot.com/> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com <http://exceldailytip.blogspot.com/> To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
Doing that, it doesn´t return the error anymore, but the macro still doesn´t copy the information :s, is it any complication with excel 2010? 2011/7/22 Rajan_Verma > *Set Wb=ActiveWorkbook* > > * * > > *From:* excel-macros@googlegroups.com [mailto: > excel-macros@googlegroups.com] *On Behalf Of *Jorge Marques > *Sent:* Thursday, July 21, 2011 10:44 PM > *To:* excel-macros@googlegroups.com > *Subject:* $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving > same error > > ** ** > > Hi guys, i have this macro i use to copy a range from column D of a > worksheet of a workbook to column G of another workbook and worksheet, but > it keeps giving me the same error saying that it´s "subscript out of range" > in the line in yellow. > > > > Public wb, wbmes As Workbook > > Sub filldatabase() > > Call AbrirFile > Call left > > wbmes.Close > > End Sub > > Private Sub AbrirFile() > > Dim Filter, Caption As String > Dim SelectedFile As Variant > > Set wb = ThisWorkbook > > > Filter = "Ficheiro XLS (*.xls),(*.xls)" > Caption = "Escolha o ficheiro a importar..." > > SelectedFile = Application.GetOpenFilename(Filter, , Caption) > > If SelectedFile = False Then Exit Sub > > Set wbmes = Workbooks.Open(SelectedFile, 1, 1) > > End Sub > > > Private Sub left() > > Dim a As Double > > wbmes.Activate > wbmes.Sheets("Total_Refrige").Select > wbmes.Sheets("Total_Refrige").Range(Range("D2"), > Range("D2").End(xlDown)).Copy > wb.Activate > > If wb.Sheets("Pivot").Range("G2").Value <> "" Then > wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select > Else > wb.Sheets("Pivot").Range("G2").Select > End If > > a = ActiveCell.Row > > wb.Sheets("Total Refrige").Paste > > Application.CutCopyMode = False > > i = a > > While wb.Sheets("Pivot").Range("G" & i).Value <> "" > i = i + 1 > > Wend > > End Sub > > > > Do you have any idea how to solve this?1000 thanks > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
RE: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
Set Wb=ActiveWorkbook From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Jorge Marques Sent: Thursday, July 21, 2011 10:44 PM To: excel-macros@googlegroups.com Subject: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error Hi guys, i have this macro i use to copy a range from column D of a worksheet of a workbook to column G of another workbook and worksheet, but it keeps giving me the same error saying that it´s "subscript out of range" in the line in yellow. Public wb, wbmes As Workbook Sub filldatabase() Call AbrirFile Call left wbmes.Close End Sub Private Sub AbrirFile() Dim Filter, Caption As String Dim SelectedFile As Variant Set wb = ThisWorkbook Filter = "Ficheiro XLS (*.xls),(*.xls)" Caption = "Escolha o ficheiro a importar..." SelectedFile = Application.GetOpenFilename(Filter, , Caption) If SelectedFile = False Then Exit Sub Set wbmes = Workbooks.Open(SelectedFile, 1, 1) End Sub Private Sub left() Dim a As Double wbmes.Activate wbmes.Sheets("Total_Refrige").Select wbmes.Sheets("Total_Refrige").Range(Range("D2"), Range("D2").End(xlDown)).Copy wb.Activate If wb.Sheets("Pivot").Range("G2").Value <> "" Then wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select Else wb.Sheets("Pivot").Range("G2").Select End If a = ActiveCell.Row wb.Sheets("Total Refrige").Paste Application.CutCopyMode = False i = a While wb.Sheets("Pivot").Range("G" & i).Value <> "" i = i + 1 Wend End Sub Do you have any idea how to solve this?1000 thanks -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
add this line before if condition see if it helps wb.Sheets("Pivot").select On Thu, Jul 21, 2011 at 11:56 PM, Anish Shrivastava wrote: > is it possible to attach the sheet? You can remove the data from it or > replace the values.. > > > On Thu, Jul 21, 2011 at 11:04 PM, Jorge Marques wrote: > >> Yes, the names are all ok, i double checked it, even try to change names, >> but doesn´t work :S >> >> 2011/7/21 Anish Shrivastava >> >>> Please check if the sheet name is "Pivot". >>> if not then rename it to Pivot. >>> On Thu, Jul 21, 2011 at 10:44 PM, Jorge Marques >>> wrote: >>> Hi guys, i have this macro i use to copy a range from column D of a worksheet of a workbook to column G of another workbook and worksheet, but it keeps giving me the same error saying that it´s "subscript out of range" in the line in yellow. Public wb, wbmes As Workbook Sub filldatabase() Call AbrirFile Call left wbmes.Close End Sub Private Sub AbrirFile() Dim Filter, Caption As String Dim SelectedFile As Variant Set wb = ThisWorkbook Filter = "Ficheiro XLS (*.xls),(*.xls)" Caption = "Escolha o ficheiro a importar..." SelectedFile = Application.GetOpenFilename(Filter, , Caption) If SelectedFile = False Then Exit Sub Set wbmes = Workbooks.Open(SelectedFile, 1, 1) End Sub Private Sub left() Dim a As Double wbmes.Activate wbmes.Sheets("Total_Refrige").Select wbmes.Sheets("Total_Refrige").Range(Range("D2"), Range("D2").End(xlDown)).Copy wb.Activate If wb.Sheets("Pivot").Range("G2").Value <> "" Then wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select Else wb.Sheets("Pivot").Range("G2").Select End If a = ActiveCell.Row wb.Sheets("Total Refrige").Paste Application.CutCopyMode = False i = a While wb.Sheets("Pivot").Range("G" & i).Value <> "" i = i + 1 Wend End Sub Do you have any idea how to solve this?1000 thanks -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel >>> >>> -- >>> >>> -- >>> Some important links for excel users: >>> 1. Follow us on TWITTER for tips tricks and links : >>> http://twitter.com/exceldailytip >>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 >>> 3. Excel tutorials at http://www.excel-macros.blogspot.com >>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com >>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com >>> >>> To post to this group, send email to excel-macros@googlegroups.com >>> >>> <><><><><><><><><><><><><><><><><><><><><><> >>> Like our page on facebook , Just follow below link >>> http://www.facebook.com/discussexcel >>> >> >> -- >> >> -- >> Some important links for excel users: >> 1. Follow us on TWITTER for tips tricks and links : >> http://twitter.com/exceldailytip >> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 >> 3. Excel tutorials at http://www.excel-macros.blogspot.com >> 4. Learn VBA Macros at http://www.quickvba.blogspot.com >> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com >> >> To post to this group, send email to excel-macros@googlegroups.com >> >> <><><><><><><><><><><><><><><><><><><><><><> >> Like our page on facebook , Just follow below link >> http://www.facebook.com/discussexcel >> > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- *Regards* * * *Ashish Koul* *akoul*.*b
Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
is it possible to attach the sheet? You can remove the data from it or replace the values.. On Thu, Jul 21, 2011 at 11:04 PM, Jorge Marques wrote: > Yes, the names are all ok, i double checked it, even try to change names, > but doesn´t work :S > > 2011/7/21 Anish Shrivastava > >> Please check if the sheet name is "Pivot". >> if not then rename it to Pivot. >> On Thu, Jul 21, 2011 at 10:44 PM, Jorge Marques >> wrote: >> >>> Hi guys, i have this macro i use to copy a range from column D of a >>> worksheet of a workbook to column G of another workbook and worksheet, but >>> it keeps giving me the same error saying that it´s "subscript out of range" >>> in the line in yellow. >>> >>> Public wb, wbmes As Workbook >>> Sub filldatabase() >>> Call AbrirFile >>> Call left >>> wbmes.Close >>> End Sub >>> Private Sub AbrirFile() >>> Dim Filter, Caption As String >>> Dim SelectedFile As Variant >>> Set wb = ThisWorkbook >>> >>> Filter = "Ficheiro XLS (*.xls),(*.xls)" >>> Caption = "Escolha o ficheiro a importar..." >>> SelectedFile = Application.GetOpenFilename(Filter, , Caption) >>> If SelectedFile = False Then Exit Sub >>> Set wbmes = Workbooks.Open(SelectedFile, 1, 1) >>> End Sub >>> >>> Private Sub left() >>> Dim a As Double >>> wbmes.Activate >>> wbmes.Sheets("Total_Refrige").Select >>> wbmes.Sheets("Total_Refrige").Range(Range("D2"), >>> Range("D2").End(xlDown)).Copy >>> wb.Activate >>> If wb.Sheets("Pivot").Range("G2").Value <> "" Then >>> wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select >>> Else >>> wb.Sheets("Pivot").Range("G2").Select >>> End If >>> a = ActiveCell.Row >>> wb.Sheets("Total Refrige").Paste >>> Application.CutCopyMode = False >>> i = a >>> While wb.Sheets("Pivot").Range("G" & i).Value <> "" >>> i = i + 1 >>> >>> Wend >>> End Sub >>> >>> Do you have any idea how to solve this?1000 thanks >>> >>> -- >>> >>> -- >>> Some important links for excel users: >>> 1. Follow us on TWITTER for tips tricks and links : >>> http://twitter.com/exceldailytip >>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 >>> 3. Excel tutorials at http://www.excel-macros.blogspot.com >>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com >>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com >>> >>> To post to this group, send email to excel-macros@googlegroups.com >>> >>> <><><><><><><><><><><><><><><><><><><><><><> >>> Like our page on facebook , Just follow below link >>> http://www.facebook.com/discussexcel >>> >> >> -- >> >> -- >> Some important links for excel users: >> 1. Follow us on TWITTER for tips tricks and links : >> http://twitter.com/exceldailytip >> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 >> 3. Excel tutorials at http://www.excel-macros.blogspot.com >> 4. Learn VBA Macros at http://www.quickvba.blogspot.com >> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com >> >> To post to this group, send email to excel-macros@googlegroups.com >> >> <><><><><><><><><><><><><><><><><><><><><><> >> Like our page on facebook , Just follow below link >> http://www.facebook.com/discussexcel >> > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
Yes, the names are all ok, i double checked it, even try to change names, but doesn´t work :S 2011/7/21 Anish Shrivastava > Please check if the sheet name is "Pivot". > if not then rename it to Pivot. > On Thu, Jul 21, 2011 at 10:44 PM, Jorge Marques wrote: > >> Hi guys, i have this macro i use to copy a range from column D of a >> worksheet of a workbook to column G of another workbook and worksheet, but >> it keeps giving me the same error saying that it´s "subscript out of range" >> in the line in yellow. >> >> Public wb, wbmes As Workbook >> Sub filldatabase() >> Call AbrirFile >> Call left >> wbmes.Close >> End Sub >> Private Sub AbrirFile() >> Dim Filter, Caption As String >> Dim SelectedFile As Variant >> Set wb = ThisWorkbook >> >> Filter = "Ficheiro XLS (*.xls),(*.xls)" >> Caption = "Escolha o ficheiro a importar..." >> SelectedFile = Application.GetOpenFilename(Filter, , Caption) >> If SelectedFile = False Then Exit Sub >> Set wbmes = Workbooks.Open(SelectedFile, 1, 1) >> End Sub >> >> Private Sub left() >> Dim a As Double >> wbmes.Activate >> wbmes.Sheets("Total_Refrige").Select >> wbmes.Sheets("Total_Refrige").Range(Range("D2"), >> Range("D2").End(xlDown)).Copy >> wb.Activate >> If wb.Sheets("Pivot").Range("G2").Value <> "" Then >> wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select >> Else >> wb.Sheets("Pivot").Range("G2").Select >> End If >> a = ActiveCell.Row >> wb.Sheets("Total Refrige").Paste >> Application.CutCopyMode = False >> i = a >> While wb.Sheets("Pivot").Range("G" & i).Value <> "" >> i = i + 1 >> >> Wend >> End Sub >> >> Do you have any idea how to solve this?1000 thanks >> >> -- >> >> -- >> Some important links for excel users: >> 1. Follow us on TWITTER for tips tricks and links : >> http://twitter.com/exceldailytip >> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 >> 3. Excel tutorials at http://www.excel-macros.blogspot.com >> 4. Learn VBA Macros at http://www.quickvba.blogspot.com >> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com >> >> To post to this group, send email to excel-macros@googlegroups.com >> >> <><><><><><><><><><><><><><><><><><><><><><> >> Like our page on facebook , Just follow below link >> http://www.facebook.com/discussexcel >> > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Help Macro doesn´t work anymore, keeps giving same error
Please check if the sheet name is "Pivot". if not then rename it to Pivot. On Thu, Jul 21, 2011 at 10:44 PM, Jorge Marques wrote: > Hi guys, i have this macro i use to copy a range from column D of a > worksheet of a workbook to column G of another workbook and worksheet, but > it keeps giving me the same error saying that it´s "subscript out of range" > in the line in yellow. > > Public wb, wbmes As Workbook > Sub filldatabase() > Call AbrirFile > Call left > wbmes.Close > End Sub > Private Sub AbrirFile() > Dim Filter, Caption As String > Dim SelectedFile As Variant > Set wb = ThisWorkbook > > Filter = "Ficheiro XLS (*.xls),(*.xls)" > Caption = "Escolha o ficheiro a importar..." > SelectedFile = Application.GetOpenFilename(Filter, , Caption) > If SelectedFile = False Then Exit Sub > Set wbmes = Workbooks.Open(SelectedFile, 1, 1) > End Sub > > Private Sub left() > Dim a As Double > wbmes.Activate > wbmes.Sheets("Total_Refrige").Select > wbmes.Sheets("Total_Refrige").Range(Range("D2"), > Range("D2").End(xlDown)).Copy > wb.Activate > If wb.Sheets("Pivot").Range("G2").Value <> "" Then > wb.Sheets("Pivot").Range("G1").End(xlDown).Offset(1, 0).Select > Else > wb.Sheets("Pivot").Range("G2").Select > End If > a = ActiveCell.Row > wb.Sheets("Total Refrige").Paste > Application.CutCopyMode = False > i = a > While wb.Sheets("Pivot").Range("G" & i).Value <> "" > i = i + 1 > > Wend > End Sub > > Do you have any idea how to solve this?1000 thanks > > -- > > -- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel