View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
lawson lawson is offline
external usenet poster
 
Posts: 44
Default reading a formula and pasting it

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