ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet Update Help (https://www.excelbanter.com/excel-programming/304991-sheet-update-help.html)

tiptop[_5_]

Sheet Update Help
 
Hello,

I have a vba that allows me to copy stuff from a source to 2nd sheet.
But when I use it, it's copying the formula in the source box, not th
actual displayed text. How can I correct this?

Sub Network()
Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range
Set sourceRng = Range("AL6")
Set WS = Workbooks("Processed Exceptions.xls").Sheets("Processe
Exceptions")
Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
sourceRng.Copy destRng
End Su

--
Message posted from http://www.ExcelForum.com


William[_2_]

Sheet Update Help
 
Hi tiptop

Untested, but try...

Sub Network()
Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range
Set sourceRng = ActiveSheet.Range("AL6")
Set WS = Workbooks("Processed Exceptions.xls").Sheets("Processed
Exceptions")
Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
destRng.formula=sourceRng.value2
End Sub

--
XL2002
Regards

William



"tiptop " wrote in message
...
| Hello,
|
| I have a vba that allows me to copy stuff from a source to 2nd sheet.
| But when I use it, it's copying the formula in the source box, not the
| actual displayed text. How can I correct this?
|
| Sub Network()
| Dim WS As Worksheet
| Dim sourceRng As Range, destRng As Range
| Set sourceRng = Range("AL6")
| Set WS = Workbooks("Processed Exceptions.xls").Sheets("Processed
| Exceptions")
| Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
| sourceRng.Copy destRng
| End Sub
|
|
| ---
| Message posted from
http://www.ExcelForum.com/
|



David Adamson[_4_]

Sheet Update Help
 
try the pastespecial command

"tiptop " wrote in message
...
Hello,

I have a vba that allows me to copy stuff from a source to 2nd sheet.
But when I use it, it's copying the formula in the source box, not the
actual displayed text. How can I correct this?

Sub Network()
Dim WS As Worksheet
Dim sourceRng As Range, destRng As Range
Set sourceRng = Range("AL6")
Set WS = Workbooks("Processed Exceptions.xls").Sheets("Processed
Exceptions")
Set destRng = WS.Cells(Rows.Count, "D").End(xlUp)(2)
sourceRng.Copy destRng
End Sub


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 04:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com