Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code attached to a macro. The macro is associated to a
command button. When the command button is clicked, this macro will ve invoked and the display/place the result into ActiveCell. Problem I have is that the macro knows which is the active cell but unable to place the value in there. Can someone please help to let me know where is my problem ? ----------- Code Start --------------- ... Other codes .... If ActiveCell.Column < 4 Then MsgBox "Sorry! Invalud column selected. It must be on column D", vbExclamation, "Column Error" Exit Sub End If Select Case Cells(28, 3) Case 0 ActiveCell.Value = "" Range(Results_Cell) = "" Case 1 ActiveCell.Value = "" Range(Results_Cell) = "" Case Else ActiveCell.Value = "Hello" ' Test to see Hello will be place in active cell. 'ActiveCell.Value = Item(Cells(28, 3) - 1 Debug.Print "Cell(" & ActiveCell.Row & "," & ActiveCell.Column & ")=" _ & Cells(28, 3) & " " & Item(Cells(28, 3) - 1) End Select ----------- Code End ---------------- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well. I just fixed my own problem which was caused by a clear active cell
line on certain codndition in the wrong place in codes below this segment of code. "Wellie" wrote: I have the following code attached to a macro. The macro is associated to a command button. When the command button is clicked, this macro will ve invoked and the display/place the result into ActiveCell. Problem I have is that the macro knows which is the active cell but unable to place the value in there. Can someone please help to let me know where is my problem ? ----------- Code Start --------------- ... Other codes .... If ActiveCell.Column < 4 Then MsgBox "Sorry! Invalud column selected. It must be on column D", vbExclamation, "Column Error" Exit Sub End If Select Case Cells(28, 3) Case 0 ActiveCell.Value = "" Range(Results_Cell) = "" Case 1 ActiveCell.Value = "" Range(Results_Cell) = "" Case Else ActiveCell.Value = "Hello" ' Test to see Hello will be place in active cell. 'ActiveCell.Value = Item(Cells(28, 3) - 1 Debug.Print "Cell(" & ActiveCell.Row & "," & ActiveCell.Column & ")=" _ & Cells(28, 3) & " " & Item(Cells(28, 3) - 1) End Select ----------- Code End ---------------- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert 29.08 hours (shown in decimal form) to time shown in "hh:m | Excel Worksheet Functions | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Column of Text Shown = Total Times Shown? | Excel Worksheet Functions | |||
selected data not shown in graph and axis labels | Charts and Charting in Excel | |||
Named Ranges shown (or not shown) as blue means what? | Excel Worksheet Functions |