Function to Display in another Collum

martyloo

Board Regular
Joined
Sep 29, 2010
Messages
100
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:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
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
 
Upvote 0

Forum statistics

Threads
1,215,679
Messages
6,126,186
Members
449,296
Latest member
tinneytwin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top