Ok, check this out: It's kind of a neat workaround since your variables evaporate as soon as the code is finished running.
Sub MoveArrayToName()
Dim rData As Range
Dim avData As Variant
Set rData = Sheets("data").UsedRange
avData = rData
ThisWorkbook.Names.Add Name:="MyData"...
Ahk, I appreciate the links. They helped.
So, as it turns out, there doesn't seem to be a way to save variables that will last through multiple 'stages' of what's happening in the userform. Redefining all of that stuff sort of sucked and made my embarrassingly bad userform code even worse...
Hi,
I'm working on a userform. It's actually there to configure some functionality. It's got some dynamic listboxes.
Anyway, so
step 1: uses a refedit to get a range. User selects a range, presses a button. The range is passed to a array. The headers of the selected range are put into...
Sorry, that didn't come out right:
lower - returns all lower case
upper - returns all upper case
proper - returns it in what excel thinks will be proper case.
The last 2 look like the same condition. I would do this with a function.
This will do it with a function:
Function something(c1 As Range, c2 As Range)
Dim sHolder As String
Dim sResult As String
sHolder = Left(c1.Value, 1)
Select Case sHolder
Case sHolder = "0"
sResult = Left(c2, 6)...
This part is easy.
Just set your save as string and your file path to be what you want. I've got a sample I can share laying around and I'll dig it up for you.
I don't think excel can help help you with the first idea. You might want to see if your shared location has some security settings that would help.
As for the second idea, you can add a worksheet with the file path that it's currently saved in, add some simple code to check this sessions...
gosh this sounds tricky: if one of those csv files is a little off it will jack up everything. Power query supports some nifty administrative joins. You'd still have to do each one manually, working with 100 files, something is bound to go wrong.
It depends exactly on what you're trying to do. I think powerquery and excel's onboard xml mapping both feature a refresh button somewhere, so you could definitely just use the recorder to see what that button actually does. I'd expect that it would be like...
There should be a million ways to do it! PowerQuery in 2010/13, 07 has some specialized functionality for working with xml. You might be able to find a way to trick MSQT into doing it too.
It's not hard to fill a range and name it for a chart in VBA. Hui's right though, a lot of times this stuff will last longer if you do it with formulas.
I still don't understand what you want the output to look like though. Can you update your file with a sample of the chart?
I'm just curious here:
Does anybody have any experience building excel stuff in studio?
I don't have a specific question, I'm just curious if anybody has any good/bad experiences writing automation like that?
imo, get pivot data is one of the most underrated formulas. To make this be a bit easier to manage day to day, get rid of those big merged cells on the left hand side.
admittedly hacky, but not bad for having not yet finished my cup of coffee:
Sub sort()
Dim avSource() As Variant
Dim alHolder() As Long
Dim albuffer() As Long
Dim rSource As Range
Dim rOP As Range
Set rSource = Sheets("sheet1").UsedRange
avSource = rSource
ReDim alHolder(1 To...