Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Offset(columnoffset:=1).Select
Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select ActiveCell.Numberformat = "General" Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Should fix it. if it doesn't then the formula you are pasting may be referring to a cell formatted as Text. If so, can you change the formatting on that cell? -- Regards, Tom Ogilvy "anderson101" wrote in message ... I have created a very simple macro to copy the contents of one cell and paste it in another effectively creating an =If forumla. However, this new forumla will not "activate?" until I hit the F2 key and hit enter. If someone can show me the code I can use to automatically perform this function in any way (F2 then enter), I would be very appreciative! here is the code I have and the line I am having a problem with: ActiveCell.Offset(columnoffset:=1).Select Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom, thank you for your reply. What is happening is that I am creating an =if formula through a series of cell combinations (i.e. combining three cells A1&A2&A3). Then, I'm pasting the value of this combination in a new cell. Of course, it pastes like a value since that is what it is. However, I found that if I hit the F2 key to "edit" the cell and then immediately hit enter, the value realizes it is a formula and calculates accordingly. I was looking for some VB code to automatically perform this F2 and enter process. The purpose is to create a macro that dynamically creates a formula and places the result as desired (by an unsophisticated excel user). Any thoughts?
"Tom Ogilvy" wrote: ActiveCell.Offset(columnoffset:=1).Select Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select ActiveCell.Numberformat = "General" Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Should fix it. if it doesn't then the formula you are pasting may be referring to a cell formatted as Text. If so, can you change the formatting on that cell? -- Regards, Tom Ogilvy "anderson101" wrote in message ... I have created a very simple macro to copy the contents of one cell and paste it in another effectively creating an =If forumla. However, this new forumla will not "activate?" until I hit the F2 key and hit enter. If someone can show me the code I can use to automatically perform this function in any way (F2 then enter), I would be very appreciative! here is the code I have and the line I am having a problem with: ActiveCell.Offset(columnoffset:=1).Select Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Offset(columnoffset:=1).Select
Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select Selection.PasteSpecial Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False ActiveCell.formula = ActiveCell.Value ActiveCell.Offset(rowoffset:=1).Select -- Regards, Tom Ogilvy "anderson101" wrote in message ... Tom, thank you for your reply. What is happening is that I am creating an =if formula through a series of cell combinations (i.e. combining three cells A1&A2&A3). Then, I'm pasting the value of this combination in a new cell. Of course, it pastes like a value since that is what it is. However, I found that if I hit the F2 key to "edit" the cell and then immediately hit enter, the value realizes it is a formula and calculates accordingly. I was looking for some VB code to automatically perform this F2 and enter process. The purpose is to create a macro that dynamically creates a formula and places the result as desired (by an unsophisticated excel user). Any thoughts? "Tom Ogilvy" wrote: ActiveCell.Offset(columnoffset:=1).Select Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select ActiveCell.Numberformat = "General" Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Should fix it. if it doesn't then the formula you are pasting may be referring to a cell formatted as Text. If so, can you change the formatting on that cell? -- Regards, Tom Ogilvy "anderson101" wrote in message ... I have created a very simple macro to copy the contents of one cell and paste it in another effectively creating an =If forumla. However, this new forumla will not "activate?" until I hit the F2 key and hit enter. If someone can show me the code I can use to automatically perform this function in any way (F2 then enter), I would be very appreciative! here is the code I have and the line I am having a problem with: ActiveCell.Offset(columnoffset:=1).Select Selection.Copy ActiveCell.Offset(columnoffset:=-1).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Selection.Copy ' Activecell.??? what can I put here to perform what F2 key and enter does??? ActiveCell.Offset(rowoffset:=1).Select Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro code question | Excel Discussion (Misc queries) | |||
vb code question | Excel Discussion (Misc queries) | |||
A macro code question from a novice | Excel Discussion (Misc queries) | |||
VBA Code Question | Excel Programming | |||
Macro Code Question for Newbe | Excel Programming |