Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i would like my program below to read the cell entered, copy the FORMULA
enterinto it (ie. "=h91+h38/j34") and paste it on all the appropriate spread sheets (those that have a 4 in the correct cell. it currently only copies the VALUE in the cell entered... Sub M15GoToBotRight_All() On Error GoTo bob2 selected_cell = InputBox("Enter Destination cell") Formula1 = MsgBox("Copy Formula?", vbYesNo + vbDefaultButton2, "Quick fixin's") If Formula1 = vbYes Then Range(selected_cell).Select Formula2 = ActiveCell For Each w In Application.Workbooks: w.Activate If selected_cell < "" Then If Range("Sheet1!as597") = 4 Then Range(selected_cell).Select If Formula1 = vbYes Then ActiveCell = Formula2 Else If Range("Sheet1!as597") = 4 Then Application.Run "M15GoToBotRight" End If Next w: ThisWorkbook.Activate Exit Sub bob2: MsgBox ("Enter a Column and Row (Ex: z45)") End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Lawson
Try changing the line Formula2 = activecell to Formula2 = Activecell.Formula then the line that says if Formula1 = vbyes then activecell = Formula2 to If Formula1 =vbyes then Activecell.formula = Formula2 regards, Mike "lawson" wrote: i would like my program below to read the cell entered, copy the FORMULA enterinto it (ie. "=h91+h38/j34") and paste it on all the appropriate spread sheets (those that have a 4 in the correct cell. it currently only copies the VALUE in the cell entered... Sub M15GoToBotRight_All() On Error GoTo bob2 selected_cell = InputBox("Enter Destination cell") Formula1 = MsgBox("Copy Formula?", vbYesNo + vbDefaultButton2, "Quick fixin's") If Formula1 = vbYes Then Range(selected_cell).Select Formula2 = ActiveCell For Each w In Application.Workbooks: w.Activate If selected_cell < "" Then If Range("Sheet1!as597") = 4 Then Range(selected_cell).Select If Formula1 = vbYes Then ActiveCell = Formula2 Else If Range("Sheet1!as597") = 4 Then Application.Run "M15GoToBotRight" End If Next w: ThisWorkbook.Activate Exit Sub bob2: MsgBox ("Enter a Column and Row (Ex: z45)") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel is reading formula as a value | Excel Worksheet Functions | |||
Help Reading Formula - Again! | Excel Discussion (Misc queries) | |||
Reading a formula | Excel Discussion (Misc queries) | |||
Formula reading formula instead of cell content | Excel Worksheet Functions | |||
reading from another file and pasting to current file, "combobox" | New Users to Excel |