Results 1 to 11 of 11
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195

    Populating Excel Cells


    Hi Guy's, hope you are all well, are you guy's able to tell me how to populate Excel cells, i know this is Access Forum but I have never tried worked in Excel code, just Access only by inputting data to Excel and extracting data from Excel...

    The limited use i have with Excel is generating combo (data validating) based on 1 column, although this file uploaded is not relevant to a project, it is just a F1 calendar file i am playing with to test

    so column G is validated to column B

    how can I make column H = column C based on selection from G ???

    unlike access where column count in a combo and populate a column number (0) or (1) etc.....

    So:

    if i was to select Australia then column H would be: Melbourne Grand Prix Circuit
    if i was to select Japan then column H would be: Suzuka International Racing Course

    i guess I'm asking how to make the drop down list have the data in there and pass to another cell ?, done some google searching but never worked with Excel code....

    Click image for larger version. 

Name:	Capture.jpg 
Views:	26 
Size:	82.1 KB 
ID:	51430

    Once i can do this, i can then hide columns B and C and use list box (combo as I know it)

    Thanks for any help you can give

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    No code involved.
    Use Data Validation for your combo on the country column.
    Use VlookUp() to get the circuit name.

    However as they never change, and you have them anyway, why?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Thanks WGM, this only a test file so what i am trying to see if possible, like Access add 2 fields to a combo column 0 and 1

    column 0 would be equivalent to column B on the excel and column 1 would be equivalent to column C

    Not sure if Excel is similar, i can't validate 2 columns to 1 column on Excel, like mentioned, never worked with Excel code, this is also just a test file.

    So in the list, if i chose what is row 9 which would be Monaco, then i am trying to tell column H to be Circuit De Monaco from row 9 (column C)

    I don't know if possible for a listbox to look up values in column C from row 9 if row 9 was selected then put that data to another cell

    hope i have made sense

  4. #4
    Join Date
    Apr 2017
    Posts
    1,680
    2 example variants for 2 source designs, to give some example how it may work in Excel
    Attached Files Attached Files

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by DMT Dave View Post
    Thanks WGM, this only a test file so what i am trying to see if possible, like Access add 2 fields to a combo column 0 and 1

    column 0 would be equivalent to column B on the excel and column 1 would be equivalent to column C

    Not sure if Excel is similar, i can't validate 2 columns to 1 column on Excel, like mentioned, never worked with Excel code, this is also just a test file.

    So in the list, if i chose what is row 9 which would be Monaco, then i am trying to tell column H to be Circuit De Monaco from row 9 (column C)

    I don't know if possible for a listbox to look up values in column C from row 9 if row 9 was selected then put that data to another cell

    hope i have made sense
    The logic still applies?
    I use the same logic for my community work.
    I select a passenger from a lookup where the data is on another sheet.
    Then other columns are populated with distance, whether they have a blue badge or not, my phone number or not, and any notes.

    Pretty much db logic, store it once and bring it up as needed.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Thanks guy's will go into this, thanks again

  7. #7
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Thanks guys, i am looking at example now and taking note of the method =INDEX(Data1!$C$2:$C$5,MATCH($B$13,Data1!$B$2:$B$5 ,0))

    This helps massively because i can work this out i think

    Thanks again

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I use simple VlookUp()s
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I find that Index Match allows a much more flexible lookup, you aren't restricted to a single column and the order of columns in the lookup table doesn't matter.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Minty View Post
    I find that Index Match allows a much more flexible lookup, you aren't restricted to a single column and the order of columns in the lookup table doesn't matter.
    I agree, but only use that when I have to.
    I purposely set up my data, so I could use a simple Vlookup.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Hi Guy's, I have had a chance to look at this now, if i am correct here, this is how i have broke the formula down in my own method ?

    Another question follows, i guess sky is the limit

    =INDEX(SheetName
    !$C$1:C$100, Column To Populate
    MATCH($F$5, Listbox Cell Location
    A!$A$1:$A$100 Listbox Source
    ,0)) Exact Match

    Is it possible to have the highlighted blank until a option from the list is selected, even have the list blank ?

    Click image for larger version. 

Name:	Capture.JPG 
Views:	8 
Size:	29.0 KB 
ID:	51458

    hope i have asked this correctly

    ie: Bahrain is in the list but not selected ?

    reason i ask is if i have ie: 75 contact names, 75 towns, 75 postcodes, i am going to have 75 cells set as listbox

    as it stands, every cell would have a value, whereas, can i have the value on selection (blank before selected) ?

    Then i guess this part would change from
    MATCH($F$1, Listbox Cell Location
    To
    MATCH($F$1:$F$75, Listbox Cell Location

    Just wondering call cells be blank until selected ???

    Thank again guy's never really worked with Excel Formulas

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to Update excel Cells via VBA
    By lmarconi in forum Programming
    Replies: 16
    Last Post: 02-21-2022, 01:00 PM
  2. Format Excel Cells to Number
    By DMT Dave in forum Access
    Replies: 1
    Last Post: 06-06-2019, 01:11 PM
  3. Import Excel cells into Access
    By NISMOJim in forum Macros
    Replies: 1
    Last Post: 04-19-2017, 02:24 AM
  4. Query not populating ( no dropdowns in cells)
    By karmadog in forum Access
    Replies: 10
    Last Post: 03-24-2014, 06:11 AM
  5. Excel exporting in single cells
    By Paolo29011982 in forum Import/Export Data
    Replies: 0
    Last Post: 07-29-2009, 04:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums