Results 1 to 8 of 8

Thread: Pass Row and Column Number Index To Refer And Put Value To Cell Range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0

    Pass Row and Column Number Index To Refer And Put Value To Cell Range

    I have received a lot of help from this site through searching posts but can’t seem to figure out the answer to my problem so I thought I would ask my first questions after several days of trying to solve this on my own.

    I’m trying to specify a row when the user chooses a specific command button and then reference the column from a ComboBox which would determine the cell to write to. Then write the contents of the ComboBox to the specific cell.

    I can select the column and the row separately but can’t figure out the code to make them work together.

    This works to choose the desired row
    Code:
          Private Sub CommandButton1_Click()
          Dim y As Integer
          y = bBldgPlan.CommandButton1.Caption  ‘(i.e. caption is 100, row 100 is selected)
          Rows(y).Select
    This works to write the contents of the forms ComboBox to the cell but requires both column and row to be referenced. I only want the column to be referenced from the ComboBox. Writing a code that performs both the above and below functions is where I am having difficulty.
    Code:
    Private Sub CommandButton1_Click()
        .Range("A6") = Me.ComboBox1.Value
        .Range("A7") = Me.ComboBox2.Value
        .Range("A8") = Me.ComboBox3.Value    
         End With
         
    End Sub
    Although not even close, this should give an idea of what I’m trying to do.

    Code:
    Private Sub CommandButton1_Click()
         Dim y As Integer
         y=buildgPlan.CommandButton1.Caption          
        .Range(“A”) & y =Me.ComboBox1.Value
        .Range("B") & y = Me.ComboBox2.Value
        .Range("C") & y = Me.ComboBox3.Value    
        End Sub
    Any help would be greatly appreciated
    Last edited by Excel Fox; 04-19-2013 at 11:06 AM. Reason: Code Tags Added

Similar Threads

  1. Replies: 4
    Last Post: 06-01-2013, 01:08 PM
  2. Replies: 3
    Last Post: 05-23-2013, 11:17 PM
  3. Highlight Active Cell’s Row and Column
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-17-2013, 12:32 AM
  4. Lookup From Cell Range By Matching Row and Column
    By paul_pearson in forum Excel Help
    Replies: 2
    Last Post: 03-07-2013, 02:02 PM
  5. Replies: 4
    Last Post: 02-22-2013, 02:24 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
  •