It's been quite some time since I got involved in any vba and find myself struggling to relearn what I once knew. That said,
what little I did know wasn't THAT extensive -- I've spent days trying to adapt various examples to my needs with little, if
My initial thought/goal was to script some vba to concatenate a number of ranges and copy the output
to two sheets, but that proved too troublesome due to the number of columns columns and the amount of code/skill needed, so I
gave up on that pipedream. I've decided instead, now, to run formulas across several hidden worksheets linked to another
workbook containing the data and then copy the concatenated values (it's only five columns, but needs to be selectable by
row/range of rows) from the hidden worksheet to the two other worksheets, one clears the data each time the script is run,
the other to find the last line and drop the same values for a historical log.
I've had only one of the last
eighteen attempts work halfway; Several times I was able to run it once, but upon running the script again, it would error
out. I was bound and determined to not let this beat me, but I've wasted more time at work and two and a half days of my
three day weekend searching and at this point, I'm fresh out of steam -- and I hate myself for it.
Anyone have any
suggestions on how to approach this?
Edit: Incidentally, the only other requirement I have, given my second
choice/lazy approach, is that another worksheet remain in focus when the script is run to use, as a cell reference, a copy of
the linked workbook data. Optimally, it would not be selectable, but I can work that out later...
I''ve managed to piece together. Sorry for the hatchet job. If anyone can assist, it would be greatly appreciated.
Function Lastrow(sh As Worksheet)
On Error Resume Next
Lastrow = sh.Cells.Find(What:="*", _
On Error Goto 0
'Dim uiRange As Range
'Dim inputValues As Variant
'On Error Resume Next
'Set uiRange = Application.InputBox("Input a range.", Type:=8)
'On Error GoTo 0
'inputValues = uiRange.Value
'Rem manipulate inputValues
'ActiveCell.Resize(uiRange.Rows.Count, uiRange.Columns.Count).Value = inputValues
Dim vArrIn As Range ' input range
Dim vArrOut As Range ' output range
Dim oStart As String ' Starting cell of output range
Dim oEnd As String ' end cell of output range
Dim columns1 As Integer ' number of columns in array
Dim rows1 As Integer ' number of rows in array
Set vArrIn = Application.InputBox("Select Range", Type:=8)
rows1 = vArrIn.Rows.Count
columns1 = vArrIn.Columns.Count
oStart = ActiveCell.Address
'oEnd = ActiveCell.Offset(rows1 - 1, columns1 - 1).Address