Posts by KnowNoVba

    I have a two dimensional array (maybe a table). I have a value in a column in another sheet, I need to take that value and find it in the table then read the first row value (header).

    I did not declare the two dimensional array of data as table yet.

    I am trying to use index match but index match does not work for two dimensional array.

    Basically I have a horizontal row/header/1 dimensional array on the top [I index it] and need to find the data in the two dimensional array below it [I use match], and read the top value [where i get nothing].

    Can someone help?

    I wrote this one as a test and it works by itself .

    but when I put it to my other program it does not !!!

    Function IsEven(i As Integer) As Boolean

    IsEven = (i Mod 2) = 0

    End Function

    Sub loopsheets()

    Dim i As Integer

    count1 = ThisWorkbook.Worksheets.Count

    Dim ws() As Worksheet

    ReDim ws(1 To 4)

    For i = 1 To 4

    If IsEven(i) Then

    Set ws(i) = ThisWorkbook.Worksheets(i)
    Cells(1, 1).Value = 1

    End If

    Next i

    End Sub

    First this is my first post in a very long time maybe few years !!!
    second you are rude and uncultured !!!!! Judging people !!!
    3rd you did not understand my problem and and what you posted is not related !!!!!


    I am trying to loop through my worksheets and execute the macro

    Here is my problem or what i need to do

    for n = 2 to 22

    sheet (n-1).select

    sheet n. select

    'Macro here


    Next n

    Basically sheet 2 interacts with sheet 1 and sheet 4 with sheet 3 and etc

    I am trying to do something like

    Dim n as interger
    Dim ws() as worksheet
    Redim ws ()

    then I am getting lost !

    any idea ?

    Re: cpy paste destination

    I came up with a method of using that equation for a range of columns but it is long, I have to write it for columns A through M. I know no Array !

    Also something really weird happens. When I press the button to run the Macro the debugger window pops up! then I press f8 and everything is fine.

    Again I try to press play the debugger pops up but f8 is fine.

    The code is somehow f8 friendly !!!!! No red circle everything yellow no stop line

    very strange

    Re: cpy paste destination

    i love the way you explain, this computer language looks like an alien Martian language. ; )

    Basically when I copy paste from the workbooks they have to follow each other not replacing.

    Re: cpy paste destination

    it worked really well ttttttttttttttttttttttaaaaaaaaaaaaaaaaaaaannnnnnnnnnnnnnnnnxxxxxxxxxxxxxxxxxxxxx

    Now if I change .copy on the left side of = sign to something like .append would it automatically append the data without any looping ?

    Re: cpy paste destination

    You are thhhhhhhhhheeeeeeeeeeeeee bbbbbbbbbbbbbbeeeeeeeeeeeeeeeesssssssssssssssssttttttttttttttt
    it worked like a charm. Also on the left side I had the file name in lieu of sheet name.

    Now the problem I have is that for every workbook the sheet name on the left side of the = sign changes.

    Is there a way to tell the vba any workbook you open just get the sheet name. Cause they have only one sheet anyway

    Is there some wild card or Activesheet command ?

    Re: cpy paste destination

    Thank you Kenneth

    Number 5 seems to be the suspect. Cause when I go to immediate window it tells me the Active workbook is Apple.csv
    I read that active workbook is the one on top of every other one. Therefor it can not find Input sheet.

    I have to somehow tell it that the right side of the equation workbook is one that I had originally opened. Any idea ?

    Hi everyone
    this is my first post

    statement of problem

    1. copying from multiple workbooks (A, B, C, ....) into one workbook. no problem with looping through the workbooks
    2. Need to copy a cell (always the same location) into a range (always column but dynamic) of cells - I can find the range of this column with no problem-

    wbk.Sheets("Apple.csv").Range("B6").Copy Destination:=ActiveWorkbook.Sheets("Input").Range("A3", "A" & (r + 3))

    getting errors