Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Hi
What I would like to do is Starting at B4, if B4 has a number in it enter 1 in column A row same as B repeat to end of column B Thanks in advance Blue |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Hi
enter the following in A4 =IF(ISNUMBER(B4),B4,"") and copy down for all rows -- Regards Frank Kabel Frankfurt, Germany Blue wrote: Hi What I would like to do is Starting at B4, if B4 has a number in it enter 1 in column A row same as B repeat to end of column B Thanks in advance Blue |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Thanks for the reply Frank
I want to do this in code so I can use it in various spreadsheet without having to do it manually, ie Run macro ???? and it enters 1 in A if B=? Thanks Blue "Frank Kabel" wrote in message ... Hi enter the following in A4 =IF(ISNUMBER(B4),B4,"") and copy down for all rows -- Regards Frank Kabel Frankfurt, Germany |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Hi
don't know why you want a macro for this but try something like the following Sub change_b() Dim RowNdx As Long Dim LastRow As Long Application.ScreenUpdating = False LastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).row For RowNdx = LastRow To 4 Step -1 with Cells(RowNdx, "B") if isnumeric(.value) then .offset(0,-1).value = .value End If end with Next RowNdx Application.ScreenUpdating = True End Sub -- Regards Frank Kabel Frankfurt, Germany Blue wrote: Thanks for the reply Frank I want to do this in code so I can use it in various spreadsheet without having to do it manually, ie Run macro ???? and it enters 1 in A if B=? Thanks Blue "Frank Kabel" wrote in message ... Hi enter the following in A4 =IF(ISNUMBER(B4),B4,"") and copy down for all rows -- Regards Frank Kabel Frankfurt, Germany |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Try this
Sub test() Columns("B").SpecialCells(xlCellTypeConstants, _ xlNumbers).Offset(0, -1).Value = 1 End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Blue" wrote in message ... Thanks for the reply Frank I want to do this in code so I can use it in various spreadsheet without having to do it manually, ie Run macro ???? and it enters 1 in A if B=? Thanks Blue "Frank Kabel" wrote in message ... Hi enter the following in A4 =IF(ISNUMBER(B4),B4,"") and copy down for all rows -- Regards Frank Kabel Frankfurt, Germany |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
If B4 =? enter 1 in A4
Frank and Ron thanks for the quick replies
Frank changed .offset(0,-1).value = .value to .offset(0,-1).value = 1 This gave the answer I wanted. Ron your code worked great as well. Thanks to you both Blue |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to select cells in column enter data then press enter | New Users to Excel | |||
Enter multiple numbers in a cell so total shows when enter keypres | Excel Worksheet Functions | |||
Enter info in one sheet, auto enter in another based on one field | New Users to Excel | |||
Auto enter date when data in enter in another cell | Excel Worksheet Functions | |||
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. | Excel Worksheet Functions |