+ Reply to Thread
Results 1 to 3 of 3

macro to transfer data between two columns with a condition

  1. #1
    Registered User
    Join Date
    11-05-2008
    Location
    France
    Posts
    28

    macro to transfer data between two columns with a condition

    I would like to say that I am new to excel programming.

    I have temperature data of many cities for a year i.e (8760 hours) in a sheet called 'Temp'. So we have the columns with cities names in this sheet.

    I am doing my calculations in a sheet called 'calc'.
    Here I have a cell called 'X' which gets the value i.e name of the city from a combobox change.

    So I make a check ,if the value entered is Paris , the cell 'X' gets Paris, then I need to transfer the temperature data of Paris from sheet 'temp' to a column 'B' in sheet 'calc'.

    I hope that I explained my problem in a simple manner.
    I would like to have a macro or a solution which will help me to proceed further. Please do message me if you need further explanations.

    Thanks
    Taniks

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    lookup

    Hi
    Which row of the column "Paris" you need pulled. if you have city names in row 2 and 100 rows of data, B1 of calc sheet
    = HLOOKUP(X,temp!A2:Z100,23,False) will return 24th row from the column paris
    Ravi

  3. #3
    Registered User
    Join Date
    11-05-2008
    Location
    France
    Posts
    28

    more info

    Hi
    I would like thank you for your reply.

    I have the names of the cities in the range C4(paris),D4(madrid),E4(brussels) etc and so on in sheet 'temp'.

    I compare the value in the range D8(paris for ex.) in sheet 'calc' with all the names of the cities in the range C4(paris),D4(madrid),E4(brussels) .... in sheet'temp'.

    // if calc.range("D8").value is equal to temp.range("C4") or temp.range("D4")or temp.range("D4") //

    then calc.range("C14") should be the value temp.range("C6") if calc.range("D8").value = temp.range("C4") ' this will the first temperture value at 0 heure.

    SO i need to transfer all the temperture data for 8760 hours from columns C,D,E etc ( ex from C6 to C8766) in sheet 'temp' to the column 'C' all the time in sheet 'calc' starting from C14 to C8774.

    so everytime when i make a check, i need the transfer the temperature data corresponding to the city i slelected.

    I need to transfer all the 8760 data from one column to another depending upon the city .

    Thanks a lot for your help!
    Taniks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1