Function to Display in another Collum

martyloo

Board Regular
Joined
Sep 29, 2010
Messages
96
Hi all my code so far is the following:

Sub Ace_Click1()
Dim NC As Integer
NC = WorksheetFunction.Max(2, Cells(19, Columns.Count).End(xlToLeft).Column + 1)
Cells(19, NC).Value = 11
NC = WorksheetFunction.Max(2, Cells(21, Columns.Count).End(xlToLeft).Column + 1)
Cells(21, NC).Value = 1
End Sub

When the Ace button is clicked the value 11 displays in cell B19 and the Value 1 displays in cell B21

All of the above code is fine except I want the values to display in cell E19 and E21 first rather than B19 / and B21 but I have no idea how to do it!?

Any help would be fantastic


IGNORE THIS ITS SORTED!!!
 
Last edited:

machopicho

Well-known Member
Joined
Feb 28, 2010
Messages
606
Sub Ace_Click1()
Dim NC As Integer
NC = WorksheetFunction.Max(2, Cells(19, Columns.Count).End(xlToLeft).Column + 1)
Cells(19, NC+2).Value = 11
NC = WorksheetFunction.Max(2, Cells(21, Columns.Count).End(xlToLeft).Column + 1)
Cells(21, NC+2).Value = 1
End Sub
 

Forum statistics

Threads
1,081,530
Messages
5,359,347
Members
400,524
Latest member
Excelbat

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top