+ Reply to Thread
Results 1 to 5 of 5

Insert a the value in specific place

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-23-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    109

    Insert a the value in specific place

    Hello guys I got help from you also generated a part of the code by myself,

    I should need help to add a little thing.

    I use i= a cell (specified by some criteria)

    now I would like to Put the result "myTot" on the same row but in Column T the value


    Sub CheckMatch()
    
    For i = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
        If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
           
    
    'Dim DivAB As String
    
    'Rows(i).Select
    
    'Cells(i, 1).EntireRow.Interior.ColorIndex = 6
    'Cells(i, "B").Select
    myCell = Cells(i, "B").Text
    mycellSel = Cells(i, "B").Select
    mycellRes = myCell - 1
    DivAB = Cells(i, "AB").Text
    
    mytot = Round(DivAB / mycellRes)
    MsgBox mytot                                     ' Put myTot (result) in Column T same row 
    
    
        End If
    Next i
    
    
    End Sub

    Could someone help me?

    Thank you in advance

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Insert a the value in specific place

    Maybe:

    Sub elmnasy()
    For i = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).row
        If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
           
    
    'Dim DivAB As String
    
    'Rows(i).Select
    
    'Cells(i, 1).EntireRow.Interior.ColorIndex = 6
    'Cells(i, "B").Select
    myCell = Cells(i, "B").Text
    mycellSel = Cells(i, "B").Select
    mycellRes = myCell - 1
    DivAB = Cells(i, "AB").Text
    
    mytot = Round(DivAB / mycellRes)
    Cells(i, "T") = mytot
    
    
        End If
    Next i
    
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: Insert a the value in specific place

    I think this will do:
    Sub CheckMatch()
    
    For i = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row
        If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
           
    
    'Dim DivAB As String
    
    'Rows(i).Select
    
    'Cells(i, 1).EntireRow.Interior.ColorIndex = 6
    'Cells(i, "B").Select
    myCell = Cells(i, "B").Text
    mycellSel = Cells(i, "B").Select
    mycellRes = myCell - 1
    DivAB = Cells(i, "AB").Text
    
    mytot = Round(DivAB / mycellRes)
    MsgBox mytot                                     ' Put myTot (result) in Column T same row 
    cells(i,20)=myTot
    
        End If
    Next i
    
    
    End Sub

  4. #4
    Forum Contributor
    Join Date
    02-23-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    109

    Re: Insert a the value in specific place

    Thank you work as a charm!

  5. #5
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: Insert a the value in specific place

    You are welcome! Glad to be able to help someone for once.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 11-19-2014, 03:38 PM
  2. HOw to insert or place a photo in excel?
    By Prashant Jadhav in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-26-2014, 12:22 AM
  3. Insert image and image name into specific place on sheet
    By ACE23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2014, 04:41 AM
  4. Macro to insert image on specific place
    By kooijman599 in forum Word Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 05:56 PM
  5. insert a photo (any file type), resize it, and place it in a specific location.
    By jaganath in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2010, 08:44 AM

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