VBA Rubberducking

This chat has moved to Discord: discord.gg/MYX9RECenJ
Nov 18, 2016 19:02
ok thanks
Nov 18, 2016 18:59
so I know the macros work. I just can't get them to run in sequence and create a second sheet.
Nov 18, 2016 18:58
They are two macros doing different actions off of the same sheet. I know they work independently. When I combine them in the public call it doesn't make the second call.
Nov 18, 2016 18:57
Right now, I have narrowed it to the code not making the second call.
Nov 18, 2016 18:51
quick question, I am trying to run a public macro in VBA but it is only making one of the calls. I can't figure out why it isn't creating a second sheet. I have created a stack question, but I haven't been able to get it resolved. Tried to plug it in rubber duck, but can't figure it out. Any help would be awesome! stackoverflow.com/questions/40333489/…
Oct 12, 2016 03:44
@Mat'sMug Hey just stopping in to see what's up.
Aug 30, 2016 15:07
No there is only one sub.
Aug 30, 2016 15:05
Yes that is in the most recent code post. I get a "Compile error" sub or function not identified.
Aug 30, 2016 15:03
I added your first code post back in the code because i understood it to mean that you corrected the error.
Aug 30, 2016 15:02
OK, when i run the code you added with the "Private Sub NewMethod(ByRef FinalRow As Long, ByRef DataSheet As String)" It doesn't recognize it as a module and nothing runs. Which is what I believe you meant by misplacing the procedure.
Aug 30, 2016 14:54
it highlights the "newmethod" line
Aug 30, 2016 14:53
Sorry, Sub or Function not defined.
Aug 30, 2016 14:50
Just to confirm, i added the attached code should be what it looks like, now i am getting a method issue.
Aug 30, 2016 14:49
Sub PivotTableLoop()

Dim FinalRow As Long
Dim DataSheet As String
Dim ws As Worksheet
Dim wb As Workbook

Set wb = ActiveWorkbook
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
DataSheet = ActiveSheet.Name

For Each ws In ActiveWorkbook.Worksheets
NewMethod FinalRow, DataSheet

'set data range for Pivot Table
Set DataRng = Sheets(DataSheet).Range(Cells(1, 1), Cells(FinalRow, 8)) ' conversion of R1C1:R & FinalRow & C8

'set range for Pivot table placement
Set TableDest = Sheets(DataSheet).Cells(1, 9) ' conversion of R1C9
Aug 30, 2016 14:25
glad my mistakes could be of assistance. :) i will definitely be using rubberduck
Aug 30, 2016 14:24
Alright, i am trying to work through this really quickly to see if it works.
Aug 30, 2016 14:12
yeah and sorry for the crap code
Aug 30, 2016 14:12
i realized what you meant when i added a msg.box. It would go to each additional sheet, but not produce an output. The logic is just new to me at this point.
Aug 30, 2016 14:10
so you suggest rubberduck to help resolve this?
Aug 30, 2016 14:09
this is a completely new space for me. so please understand, this has been a difficult process without classes lol
Aug 30, 2016 14:08
i am just doing this manually
Aug 30, 2016 14:08
So i have been trying to play with the script and moving things around but just keep breaking things.
Aug 30, 2016 14:07
Hey Mat, thanks for taking the time to chat.