PC Review


Reply
 
 
=?Utf-8?B?cmFyYXNjaGVr?=
Guest
Posts: n/a
 
      6th Apr 2007
please, i need to copy a cell from a static worksheet, and paste it into a
concrete cell in a new generated worksheet. i´m trying to use something like
this, thanx for ideas.
wsAS.Cells(ActiveCell.Row, 4).Value = ws.Cells("B5").PasteSpecial
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      6th Apr 2007
I'm assuming you want to copy cell B5 from ws to wsAS.

Did you try this?

wsAS.cells(Activecell.row,4).value = ws.cells("B5").value

"raraschek" wrote:

> please, i need to copy a cell from a static worksheet, and paste it into a
> concrete cell in a new generated worksheet. i´m trying to use something like
> this, thanx for ideas.
> wsAS.Cells(ActiveCell.Row, 4).Value = ws.Cells("B5").PasteSpecial

 
Reply With Quote
 
=?Utf-8?B?cmFyYXNjaGVr?=
Guest
Posts: n/a
 
      6th Apr 2007
Yes, I tried that. Anyway I want the cell (activerow,column4) to be copied
into the new ws(cell B5). i tried to reverse the formula, but it doesnt
work...
(error 1004)

"Barb Reinhardt" wrote:

> I'm assuming you want to copy cell B5 from ws to wsAS.
>
> Did you try this?
>
> wsAS.cells(Activecell.row,4).value = ws.cells("B5").value
>


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      6th Apr 2007
You can use also value if you not want to copy formatting
with wsAS active try this

ws.Cells("B5").value = wsAS.Cells(ActiveCell.Row, 4).Value

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"raraschek" <(E-Mail Removed)> wrote in message news:9ABE4998-9E76-447F-BCB8-(E-Mail Removed)...
> please, i need to copy a cell from a static worksheet, and paste it into a
> concrete cell in a new generated worksheet. i´m trying to use something like
> this, thanx for ideas.
> wsAS.Cells(ActiveCell.Row, 4).Value = ws.Cells("B5").PasteSpecial


 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      6th Apr 2007
Oops, I missed something.

1) Before this line, check to ensure that ws.name and wsAS.name are really
worksheet names (checks to see if worksheets are defined.
2) Try this formula

wsAS.cells(Activecell.row,4).value = ws.range("B5").value


"raraschek" wrote:

> Yes, I tried that. Anyway I want the cell (activerow,column4) to be copied
> into the new ws(cell B5). i tried to reverse the formula, but it doesnt
> work...
> (error 1004)
>
> "Barb Reinhardt" wrote:
>
> > I'm assuming you want to copy cell B5 from ws to wsAS.
> >
> > Did you try this?
> >
> > wsAS.cells(Activecell.row,4).value = ws.cells("B5").value
> >

>

 
Reply With Quote
 
=?Utf-8?B?cmFyYXNjaGVr?=
Guest
Posts: n/a
 
      7th Apr 2007
ok, i tried every possibilty, but it didn´t work. do you have any idea?
thanx

"Ron de Bruin" wrote:

> You can use also value if you not want to copy formatting
> with wsAS active try this
>
> ws.Cells("B5").value = wsAS.Cells(ActiveCell.Row, 4).Value
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "raraschek" <(E-Mail Removed)> wrote in message news:9ABE4998-9E76-447F-BCB8-(E-Mail Removed)...
> > please, i need to copy a cell from a static worksheet, and paste it into a
> > concrete cell in a new generated worksheet. i´m trying to use something like
> > this, thanx for ideas.
> > wsAS.Cells(ActiveCell.Row, 4).Value = ws.Cells("B5").PasteSpecial

>
>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      7th Apr 2007
Post your complete code so we can see what you are trying to do

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"raraschek" <(E-Mail Removed)> wrote in message news:3B1E70CC-7478-4BBB-8829-(E-Mail Removed)...
> ok, i tried every possibilty, but it didn´t work. do you have any idea?
> thanx
>
> "Ron de Bruin" wrote:
>
>> You can use also value if you not want to copy formatting
>> with wsAS active try this
>>
>> ws.Cells("B5").value = wsAS.Cells(ActiveCell.Row, 4).Value
>>
>> --
>>
>> Regards Ron de Bruin
>> http://www.rondebruin.nl/tips.htm
>>
>>
>> "raraschek" <(E-Mail Removed)> wrote in message news:9ABE4998-9E76-447F-BCB8-(E-Mail Removed)...
>> > please, i need to copy a cell from a static worksheet, and paste it into a
>> > concrete cell in a new generated worksheet. i´m trying to use something like
>> > this, thanx for ideas.
>> > wsAS.Cells(ActiveCell.Row, 4).Value = ws.Cells("B5").PasteSpecial

>>
>>


 
Reply With Quote
 
=?Utf-8?B?cmFyYXNjaGVr?=
Guest
Posts: n/a
 
      8th Apr 2007
ok, thank you
---------------------------------
Sub Create()
Dim ws As Worksheet
Dim wsName As String, Name As String
Dim MsgError As String

MsgError = "Zadaný list už existuje! Vyberte bunku s iným listom. Potvrďte
End."

'no empty cell when generating ws
If Not IsEmpty(ActiveCell) Then
Name = ActiveCell.Value

Set ws = Worksheets.Add
ws.Move After:=Sheets(Sheets.Count)

'not to have two equal ws
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
If wks.Name = Name Then
MsgBox (MsgError)
End If
Next wks
ws.Name = Name

'new ws data and action

Dim wsCopyFrom As Worksheet
Set wsCopyFrom = Worksheets("mod")
Dim wsAS As Worksheet
Set wsAS = Worksheets("AS visit report")
Dim Msg As String
Dim datum As Range
Dim datumenter As Range

wsAS.Cells(ActiveCell.Row, 4).Copy
ws.Range("B5").PasteSpecial (xlPasteAll)

ws.Cells("B5").Value = wsAS.Cells(ActiveCell.Row, 4).Value

'end of creating ws

Msg = "Vložte údaje"
MsgBox (Msg)

End If
End Sub

"Ron de Bruin" wrote:

> Post your complete code so we can see what you are trying to do
>
> --
>


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      8th Apr 2007
First I not see that you have Cells instead of Range in your code yesterday

I make the code a bit shorter
Try this with the value you want to copy on the activesheet

Sub Create()
Dim ws As Worksheet
Dim str As String
Dim Name As String

'no empty cell when generating ws
If Not IsEmpty(ActiveCell) Then
Name = ActiveCell.Value

str = ActiveSheet.Cells(ActiveCell.Row, 4).Value
Set ws = Worksheets.Add(After:=Sheets(Sheets.Count))

ws.Range("B5").Value = str

On Error Resume Next
ws.Name = Name
If Err.Number > 0 Then
MsgBox "Change the name of : " & ws.Name & " manually"
Err.Clear
End If
On Error GoTo 0

End If
End Sub




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"raraschek" <(E-Mail Removed)> wrote in message news:B05BECDE-5015-473E-8A88-(E-Mail Removed)...
> ok, thank you
> ---------------------------------
> Sub Create()
> Dim ws As Worksheet
> Dim wsName As String, Name As String
> Dim MsgError As String
>
> MsgError = "Zadaný list už existuje! Vyberte bunku s iným listom. Potvrďte
> End."
>
> 'no empty cell when generating ws
> If Not IsEmpty(ActiveCell) Then
> Name = ActiveCell.Value
>
> Set ws = Worksheets.Add
> ws.Move After:=Sheets(Sheets.Count)
>
> 'not to have two equal ws
> Dim wks As Worksheet
> For Each wks In ActiveWorkbook.Worksheets
> If wks.Name = Name Then
> MsgBox (MsgError)
> End If
> Next wks
> ws.Name = Name
>
> 'new ws data and action
>
> Dim wsCopyFrom As Worksheet
> Set wsCopyFrom = Worksheets("mod")
> Dim wsAS As Worksheet
> Set wsAS = Worksheets("AS visit report")
> Dim Msg As String
> Dim datum As Range
> Dim datumenter As Range
>
> wsAS.Cells(ActiveCell.Row, 4).Copy
> ws.Range("B5").PasteSpecial (xlPasteAll)
>
> ws.Cells("B5").Value = wsAS.Cells(ActiveCell.Row, 4).Value
>
> 'end of creating ws
>
> Msg = "Vložte údaje"
> MsgBox (Msg)
>
> End If
> End Sub
>
> "Ron de Bruin" wrote:
>
>> Post your complete code so we can see what you are trying to do
>>
>> --
>>

>


 
Reply With Quote
 
=?Utf-8?B?cmFyYXNjaGVr?=
Guest
Posts: n/a
 
      8th Apr 2007
thank you, with your help i changed the code and it works as i wanted.


"Ron de Bruin" wrote:

> First I not see that you have Cells instead of Range in your code yesterday
>
> I make the code a bit shorter
> Try this with the value you want to copy on the activesheet
>
> Sub Create()
> Dim ws As Worksheet
> Dim str As String
> Dim Name As String
>
> 'no empty cell when generating ws
> If Not IsEmpty(ActiveCell) Then
> Name = ActiveCell.Value
>
> str = ActiveSheet.Cells(ActiveCell.Row, 4).Value
> Set ws = Worksheets.Add(After:=Sheets(Sheets.Count))
>
> ws.Range("B5").Value = str
>
> On Error Resume Next
> ws.Name = Name
> If Err.Number > 0 Then
> MsgBox "Change the name of : " & ws.Name & " manually"
> Err.Clear
> End If
> On Error GoTo 0
>
> End If
> End Sub
>
>
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
> "raraschek" <(E-Mail Removed)> wrote in message news:B05BECDE-5015-473E-8A88-(E-Mail Removed)...
> > ok, thank you
> > ---------------------------------
> > Sub Create()
> > Dim ws As Worksheet
> > Dim wsName As String, Name As String
> > Dim MsgError As String
> >
> > MsgError = "Zadaný list už existuje! Vyberte bunku s iným listom. Potvrďte
> > End."
> >
> > 'no empty cell when generating ws
> > If Not IsEmpty(ActiveCell) Then
> > Name = ActiveCell.Value
> >
> > Set ws = Worksheets.Add
> > ws.Move After:=Sheets(Sheets.Count)
> >
> > 'not to have two equal ws
> > Dim wks As Worksheet
> > For Each wks In ActiveWorkbook.Worksheets
> > If wks.Name = Name Then
> > MsgBox (MsgError)
> > End If
> > Next wks
> > ws.Name = Name
> >
> > 'new ws data and action
> >
> > Dim wsCopyFrom As Worksheet
> > Set wsCopyFrom = Worksheets("mod")
> > Dim wsAS As Worksheet
> > Set wsAS = Worksheets("AS visit report")
> > Dim Msg As String
> > Dim datum As Range
> > Dim datumenter As Range
> >
> > wsAS.Cells(ActiveCell.Row, 4).Copy
> > ws.Range("B5").PasteSpecial (xlPasteAll)
> >
> > ws.Cells("B5").Value = wsAS.Cells(ActiveCell.Row, 4).Value
> >
> > 'end of creating ws
> >
> > Msg = "Vložte údaje"
> > MsgBox (Msg)
> >
> > End If
> > End Sub
> >
> > "Ron de Bruin" wrote:
> >
> >> Post your complete code so we can see what you are trying to do
> >>
> >> --
> >>

> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Microsoft Excel Misc 0 29th Jun 2009 11:20 AM
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Yuvraj Microsoft Excel Misc 0 26th Jun 2009 06:01 PM
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell suyash.nathani@gmail.com Microsoft Excel Worksheet Functions 2 7th Nov 2007 09:39 AM
I copy a formula and the results copy from the original cell =?Utf-8?B?YnJvb2tseW5zZA==?= Microsoft Excel Misc 1 23rd Jun 2007 01:35 AM
If cell in a Col of doc1is = to cell in a Col in doc2, copy cell . =?Utf-8?B?RERD?= Microsoft Excel New Users 2 6th Oct 2004 12:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 AM.