Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Active Cells Paste


can any one please help me
if i have specified a cell as the active cell but then i want to paste a value in a cell two or 3 columns away from the active cell this is using vb in excel.

cheers stuart




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
To Determine The Rows To Paste A Worksheet(blank Cells To Paste Next Worksheet)
hi all experts out there....

would llike u guys to help out with a problem i am facing....


the code below is to select each of the worksheet,copy it and paste it in worksheet (printer").....i got 3 worksheets to paste into worksheet ("printer")....worksheet("11 aug"),("12 aug") and ("18 aug")....i got no problem pasting the first two worksheets("11 aug") and ("12 aug")...but i got a problem pasting the last worksheet("18 aug").....i want to paste each worksheet with a offset of (3,0) but the last worksheet paste at another cell instead......i attach the excel doc name (total)(workbook) and the macro.....the ("sub regroup")....need to be improve..pls help ......thank a lot..."P

Code:
Sub regroup()
'
' regroup Macro
' Macro recorded 9/3/2003 by SGTANCKE
'

'
Sheets("11 Aug").Select
Rows("1:" & Sheet1.UsedRange.Rows.Count).Select
Selection.Copy
Sheets("Printer").Select
Range("A1").Select
ActiveSheet.Paste

Sheets("12 AUG").Select
Rows("1:" & Sheet2.UsedRange.Rows.Count).Select
Selection.Copy

Worksheets("Printer").Activate
ActiveCell.Offset(rowOffset:=3 + Sheets("Printer").UsedRange.Rows.Count, columnOffset:=0).Activate
ActiveSheet.Paste

Sheets("18 AUG").Select
Rows("1:" & Sheet3.UsedRange.Rows.Count).Select
Selection.Copy

Worksheets("Printer").Activate
ActiveCell.Offset(rowOffset:=3 + Sheets("Printer").UsedRange.Rows.Count, columnOffset:=0).Activate
ActiveSheet.Paste


Columns("E:E").EntireColumn.AutoFit




End Sub

Copy/Paste Range Of Cells
Guys,

See code below while reading problem...

I am trying to copy a range of cells from a single column in Worksheets("Light Part L"), and paste this range into another sheet ("Harmonics"). The range must be copied/pasted across and tag onto the end of a list of data already on sheet("Harmonics").
It works fine for the first range selection and paste.
But the second range I am trying to copy is from a different column on ("Light Part L"). When I try to paste this column range to its new location on worksheet ("Harmonics")... it copies the range from the first selection and second selection, with all the columns in between as well??? Why? I just want it to copy across the range from the second selection (this will be a range in one column, not multiple columns).

Code:
'Determine end of "Input Page" loads
Dim EndInputPage As Long
EndInputPage = Range("B65536").End(xlUp).Row
EndInputPagePlus = EndInputPage + 1

'First selection and paste
With Worksheets("Light Part L")
Range(.Cells(4, 1), .Cells(.Range("A65536").End(xlUp).Row, 1)).Copy
Worksheets("Harmonics").Select
Cells(EndInputPagePlus, 2).Select
ActiveSheet.Paste
End With

'Second selection and paste
With Worksheets("Light Part L")
Range(.Cells(4, 4), .Cells(.Range("D65536").End(xlUp).Row, 1)).Copy
Worksheets("Harmonics").Select
Cells(EndInputPagePlus, 6).Select
ActiveSheet.Paste
End With
Your help would be gratefully appreciated.

Thanks,
Daryll

Copy And Paste A Range Of Cells
Hi all

This is possibly too easy for many of you, so no one has never asked here.

I got a sub and it stucked at R.offset.resize.copy ....

What did I do wrong?

Sub AvgAttempt()

Dim i, j As Integer
Dim R, R1, R2 As Range
Dim RowCount As Integer

RowCount = Selection.CurrentRegion.Rows.Count
Set i = 2
Set j = 4
For Each R In Range("A8:A" & RowCount)
If IsEmpty(R.Offset(0, 7).Value) = False Then
MsgBox (R.Offset(0, 7).Value)
R.Offset(0, 7).Resize(0, 5).Copy Destination:=Worksheets("Sheet1").Cells(2, 4)
End If
Next R
:
:
End Sub

Thank you in advance

Copy/Paste Range Of Cells
Sub test4()
'
'
Dim R1 As Long
Dim R2 As Long
Dim R3 As Long

'Determinate the range in use in column B, Worksheet "Input Page".
'(To determine what content to transfer from "Input Page" to "Harmonics")
R1 = Worksheets("Input Page").Range("B65536").End(xlUp).Row
R2 = R1 - 25

Worksheets("Input Page").Range(Cells(25, 1), Cells(R1, 21)).Cells.Copy

With Worksheets("Harmonics").Range(Cells(1, 1), Cells(R2, 21)).Cells.Paste

End With

End Sub

Think what I'm trying do do above should be pretty obvious...however I get a Run-time error '1004'. I imagine its a fairly simple fix, but a fairly simple person like me cant find it!

Any help will be most appreciated!

Copy Paste Which Cells Were Selected
Hi all,

A colleague has set up a spreadsheet. The code stops them from copying/pasting from one workbook into another (it loses the focus). Is there a way to identify the cells which have been copied so I can reselect them after running the existing code. ie I want the Range of cells with the running border round them rather than the Active or Selected cells?

As always any help is greatly appreciated.

Rob

Open Url - Copy -paste Cells - In A Loop
Your help is appreciated,

I have created an excel file with 100 (in column A1:A100)

All these URLs have the same format and they include names, addresses, etc.

for example:

URL
token=public&step=4&mid=4266752&pc=T9S%201J1

URL
token=public&step=4&mid=4265895&pc=T5J%200H8

URL
token=public&step=4&mid=4265217&pc=T5J%203S4

URL
token=public&step=4&mid=4264161&pc=T2P%203N3

I would like to automatically open these urls in an excel sheet [workbooks.open(i, 1)], select specific cells and copy them in a single sheet (Sheet2).

At the end I will have only "Sheet2" with the names, addresses, email, etc of all those 100 urls.


Thanking you in advance,

George

How To Copy And Paste Values From Cells In Excel?
Hi guys,

Is there a way to copy just the values from cells in excel....

I have a sheet that generates outputs, however, the output values are referencing other cells etc........so when i copy and paste to somewhere else, all i get is #REF in the cells.......

so basically i just want to copy the actual numbers in the cells and not formulas or anythign else.......??

all help greatly appreciated.

thanks

Copy And Paste Rows Or Cells From Flexgrid To The Clipboard
Hi,
How Can I use flexgrid to Copy and paste rows or cells from flexgrid to the clipboard.

Thankx

Select/copy/paste Cells Based On Today's Date
Thank you in advance to anyone who can pass on the gift of their script to me on this one. i work in a firm full of IT developers & support, admittedly whose expertise isn't in VB, but nonetheless you'd of thought one of them could answer this one.

I have a long macro already recorded in excel. in Column A of a particular worksheet is every work day from today to end 2009. Based on formulas contained in each corresponding cell B,C,D & F, values appear if today's date = the date in column A. I want to tell the macro at the very last step, to copy/"paste values" these cells based on selecting only cells B,C,D & F in row = today.

at the moment, 4-Mar-08 is in cell A 130 & the macro will continue, tomorrow to only copy/paste B130,C130,D130,F130 even though the values will be generated in row 131 tomorrow. the data input worksheet changes daily which is why i need to 'lock in' these end of day values with a copy/'paste values' finish to each day.

Hoping someone out there can help me.

Thanks a lot to that person,
Brian.

Active Cells
Hi

I am using the follwing lines of code to move from a cell in sheet1 to the same cell in sheet2:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.Goto (Sheets("Sheet2").Range(Target.Address))
End Sub

I need to limit this so the code only runs when a cell in column A is clicked. How do I apply this in my code?

Thanks

Paste Special To The Active Cell
Hi!
i need some help
I have 200 columns that in the 3nd row on each of them there is an input box. So, in A3, B3, C3, D3, E3 etc there is an input box. I fill the input box with numbers and a formula doing a calculation. The result of the calculation returns to the column IV starting from the row 4.
I want to copy the column IV and paste special to the column that i last use to activate the input box. (Eg.If i was on D3 and i activate the input box i want to paste special the column IV to the column D starting from the D4)

Thanks in advance
Stathis

Help With VBA/Excel?Active Cells
Hi All,

I am trying to use an event handler in VBA that will kick off a macro when only one specific cell is the active cell. Is this possible and could you provide some help? Also I wouldn't mind if it even was a 'double click'

Thanks in advance to any and all
Skyler
p.s. here is what I have so far, maybe this will add some insight, thxs

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)

Dim activeSheetName As String
activeSheetName = ActiveSheet.Name
If activeSheetName = "Sheet2" Then
If ActiveCell.Cells(5, 3).Value <> "" Then
MsgBox "Hi"
End If
End If
End Sub

Active Sheets With Cells
I don't know how explain,so I use the pic to expalin.
I want the cells of sheet or workbook active only with on first click or with arrows not double click or enter
take a look to the pic

Active Cells Movement
Hello there,

Does someone (I am sure some one does!) know, how I can detect the cursor movement, like when the user moves the cursor from one cell to another cell left. The "worksheet_change" event doesn't help, neither the "worksheet_activate" (didnt expect that). And there are no other events in the worksheet VBA table (how u call that?, it is not the vb module, but the vb code hidden behind the sheet!)

The idea is, whenever a user moves a cursor through a field with a code like "ATX3", I will show on the bottom line the description of the article ("ATX Board with 3 CPUS" (or something more senseful), from another sheet, while only the code is saved in the table.

Beside my dump question : great board! (newbie)

Active Cells Below A Word
Hi Experts,

Just learning VB.

I have a cell say "B2" with content MSC. I want to know how many active cells (non blank cells) are present below this word MSC.
What syntax will I use.

Regards
Nevil

Paste Clipboard Content In Active Window
I am trying to mimic the PureText tool of Steve Miller for use in my own application. PureText can be found here (http://stevemiller.net/puretext/).

It works, except for the function where the clipboard content, converted to text, is pasted in the active window.

I have the following code (trimmed, only the function that doesn't work is included).


Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long

Private Declare Function GetForegroundWindow Lib "user32" () As Long

Dim sTemp As String
Dim lCurHwnd As Long
Dim lEdit As Long

sTemp = Clipboard.GetText(vbCFText)
lCurHwnd = GetForegroundWindow
lEdit = FindWindowEx(lCurHwnd, 0&, "Edit", vbNullString)
SendMessageSTRING lEdit, WM_SETTEXT, 256, stemp

I think the problem is that the code doesn't return the right handle for MDI apps. Cause it does work on notepad, but not in on Word or other MDI apps.

Any suggestions ?

Def. Of Text Format In Active Cells
In my code I have this;


Code:
ActiveCell.Offset(Row, 1) = ThisWorkbook.Sheets("Hose").Cells(Row + 1, 2)

The problem is :
ActiveCell read value 1/2, When I send this value to another sheet, it gives me value 37688.

I know that I have to set in something like


Code:
ActiveCell.Offset(Row, 1).Text.Fromat........

But what more

Paste 1 Variable Divided Up Into 3 Fields With 1 Paste Command
Greetings...

I'm looking to take a variable, split it up into 3, then paste it into 3 fields, with only one button press
and it MUST paste into the first field, then tab to the second and third fields .
I'm using ASCII tab but it does not work......
So I have 3 text fields, Text1, Text2, Text3...and I want to only hit Text1 and then have it tab automatically.....
Is this possible.....here's what I have and it does not work....

For this example let's say the clipboard has on it: 222jjj666666

Dim A As String
Dim B As String
Dim C As String
Dim D As String
Dim E As String
Dim Full As String
Dim Tab1 As String

Private Sub Command2_Click()

Tab1 = Chr(13)

Full = Clipboard.GetText

A = Left(Full, 3)
B = Mid(Full, 3, 3)
C = Right(Full, 6)

E = A & Tab1 & B & Tab1 & C

Text1.Text = E
      
End Sub

I hope this makes sense......but the key here is to only hit one field and then have it tab from the code....
Any ideas would be great.....

Thanks, and always.....dreamon!!!!

Mshflexgrid: Get Values Of Cells Or Row Numbers That Relate To Merged Cells
I am using a mshflexgrid and the first 2 columns are merged. So I have 8 rows all with a value for a material code and a description that is identical and for those 8 rows I have different percentages for all my different sizes. Now when a user clicks on a row I want to get all the percentages and sizes for the material. Is there any way to get the start and end rows for a merged cells so that I can get the adjacent values that apply to the current material.
Any help is (as always) appreciated...

"The answer is out there, Neo, it’s looking for you. And it will find you, if you want it to."--Trinity to Neo

Filling Cells With Formulae That Refer To Data In Other Cells
I'm trying to create a macro that uses a DDE function. I need to fill a row with formulae that take in information from other cells, and combine with command "winros".

For instance, given 4 colums and 3 rows (the following is meant to represent a spreadsheet):

Code:
[]ABCD
1MSFTMSFTIBMIBM
2LastOpenBidAsk
3
I need to fill out Row 3 with formulae that combine the values in the rows above it. e.g., Row 3, Column A would show:

=winros|MSFT!'Last'

I need to combine =winros| with the value in cell A1 (two rows above), then with !', then with the value in cell A2 (one row above), then with '

However, I do not know how to do this How do I fill a row of cells with formulae that refer to other cells?

Filling Empty Cells In Column With Former Cells Data
What I am trying to do is shown below

Before;

Alpha One
[Blank Cell]
[Blank Cell]
[Blank Cell]
Beta Two
[Blank Cell]
[Blank Cell]
Charlie Three
[Blank Cell]
Delta Four
Epsilon Five
[Blank Cell]

After;
Alpha One
Alpha One
Alpha One
Alpha One
Beta Two
Beta Two
Beta Two
Charlie Three
Charlie Three
Delta Four
Epsilon Five
Epsilon Five

It would be great if I can select the range to be processed for the column so that it doesn't go loopy. Any help would be greatly appreciated.

Cheers
KiwiSammy

In Word, Check # Of Cells In Current Row, Then Select First Two Cells In Row
I'm trying to do a little VBA subroutine that will run in Word 2003 (VB 6.5), when insertion point is in a table.
What I want it to do is:
* Confirm the insertion point is in a table
* Go to the first row in current table
* Check if the number of cells in that row >= 5
   * If so, merge the first two cells in that row
   * If not, go to the next row
* Continue checking (and merging, if appropriate) to end of the table

I know how to check if insertion pt in in a table and how to merge two cells once they're selected, but am totally stumped on the middle part -- the real heart of the matter... (I've tried a bunch of things, using VBA Help info as a guide, but to no avail.)

* How do I determine the number of cells in the current row?
* How do I select the first two cells in current row?

Really would appreciate any help/guidance.



Edited by - topaz2 on 1/20/2007 8:44:46 PM

Looping Through Cells For Empty Cells Dynamically - Excel VBA - Need Help
Hi,
I need to run a SQL like 'Select * from xyz where xyz.column1 in {all entries from cell A1: A10}
The criteria here - cells in column A would be loaded dynamically and I would not know how many columns are there (it could be say, A1 to A10 or A1 to A 40). So basically I need to start at A1 , increment column by 1 and look for empty cells. When an empty cell is found, all values from A1 to the one before the empty cell would be included in the where query.
i would like to achieve this and would need your help in getting this done.
Thanks.
-VS

Move Non-formula Cells In A Range Up 3 Cells
Hi,

I want to write a macro to move a range (D34:L44) of cells up by three rows in a excel sheet if
a) they do not contain a formula
b) if they are non-zeros and numeric
I need to repeat this for all worksheets (about 30) that start with the letter 'A' , 'C', or 'P'
I would like to be able to execute this by macro, saving a lot of manual boredom!!
Any idea's ?
Thanks in advance

Combining Text In Cells Based On Other Cells
I have the following problem that I need to solve and VB seems the only way to do it.

I have 3 columns of information in Excel, I need to combine the text in column C based on if the information is the same in column A and then the same again in column B.

example: if a has 3 cells with the number 1 in them and column B has 2 cells with # 5 in them then Column C for the 2 matches needs to combine. and I need to add a comma after each string of text.


Thanks for your help with this.

James

Merge Cells Depending On Cells' Contents
I have two columns like

column D E

line 5 ABC 1
line 6 [empty] 2
line 7 [empty] 3
line 8 [empty] 4
line 9 ABC 1
line 10 [empty] 2
line 11 [empty] 3
....
line 60 ABC 1
line 61 [empty] 2
line 62 [empty] 3
line 63 [empty] [empty]
line 64 [empty] [empty]
....

I need to merge each cell containg text (ABC) with the empty cells below. My goal is to have some big cell with (ABC) in column D and all the cells with (1), (2), (3) in column E ... so that when I filter on column E, I don't loose the info on clumn D. (i.e. if I filter looking for (2) on column E, I will not be able to see the corresponding text (ABC) for each (2) value found by the filter)

Some facts:

* The number of empty cells below each text cell (ABC) is not constant - can be 0 as well as 100.
* The number of total text cells in column D is not constant.

My problem is that I do not know visual basic at all...
What I was thinking of in terms of algorithm is:

begin

variable CELL var1
variable CELL var2

var1 = D5
var2 = D6

while(var1 is not empty)
selection.add(var1)

while(var2 is empty)
selection.add(var2)
var2.move_one_cell_down()
end while

selection.merge

var1 = var2
var2.move_one_cell_down()

end while
end

Can it be translated into VB???

Thanks!
Edo

Difference Between Cells.value And Cells.formula?
Hello, Everyone,
I used cells.value and cells.formula interchangely. would someone be kind to let me know the difference? and which is faster process? What's needed to notice?
Thank you very much!
Charlie

How Could I Create Cells Like Excel Cells
how could i create cells like excel cells

is there any tool do this , cause i want to make in my form a table like excel spread sheats

Forcing Paste To Paste Txt In An Rtb
I need the length of an rtb, but I only want to deal with txt.

Right now the way my program's set up, if the user pastes rich text, they can then use a command that makes rtb = rtb.text and that works to remove the formatting, but I just downloaded a program from planet source code called Bobo Pad that has a rtb that works with text only and when you paste rich text into it, all you see is the txt, as if you'd pasted into notepad.

I'd like to save my users that extra step of having to unformat any rich text they may want to paste.

I've tried looking at the code, but can't figure out how it's done. Does anyone know how Bobo did it?

Here's the link to Bobo Pad at psc:

http://www.planet-source-code.com/vb...bo%5F343401485

About Active Form Name In Active Project
i'm using visual basic 6, in usercontrol section...
my objective is these:
when i put my control in form, in a project, can i see the name of that form?
these code must be implanted in a property page....
i try these code:

Code:
Private Sub PropertyPage_Initialize()
Dim i As Integer
For i = 0 To Forms.Count - 1
lstAddCollisionObject.AddItem Forms(i).Name
Next i
End Sub

but the problem is that i don't recive any name, and i just wanted the form name of the form that theres is my control.
then i can see the controls name in these form...
thanks

Active Window, That Isnt Active.? Look
ok say i have 2 programs open, my program and another one
they are running sidebye side. and the other program HAS to be active to work (it simulates mouseclicks)
my program will not be the active window but is it possible to still type in it.. i wanting MY program to be a multiuser chat program and im able to chat in it while the other program is running

Difference B/w Active-X Ctrl And Active-X Dll
Hi all,

I want the Difference b/w Active-X ctrl and Active-X Dll in terms of the Interface usage/vtTable(ie.Internal Differences and Internal Workings)...I know that it is an InProcess Components.

Thanx
Murali

What Do Active X EXEs Have That Active X DLLs Don't?
Hello - quick question on differences between VB Active X DLLs and VB Active X EXEs please.

My C++ client can show a form from a VB Active X EXE, but not from an Active X DLL with exactly the same code as the EXE. Any ideas why? The statement to Load the form is successful in the Active X DLL, its just giving a negative HRESULT on the form.show

Active X DLL does work ok if VB running in the background though.

Any info would be very much appreciated.

Thanks,
Mairi

Active X Exe Calling Active X Exe - Help
Can anyone show me example code of 1 active x exe raising an event in another active x exe ? without the use of a timer or any form controls whatsoever. Just class to class....

The only examples I can find use standard exe's etc and forms. I need 2 Ax exe talking to each other.

Active/de-active Variables
Hi

Is there and How do I check whether my variables have been destroyed?

Thanks
Holly

Creating Active-X Control That Work With Another Active-X Control
Hello Ppls,
   I've created an Active-X control say parent.ocx that work with the form's events and controls in that form. I am getting the form's things as follows.

        Dim withevents frm_parent as form
        set frm_parent=usercontrol.parent

The above things get work only when the OCX placed on a form.

Now when I am creating another usercontrol say child.ocx, I want to place that parent.ocx ino this new usercontrol. So I used the following code in parent.ocx

       dim withevents USERCTL_Parent as usercontrol
       set USERCTL_Parent =usercontrol.parent

But here when I place the child.ocx into another form, the parent.ocx is not getting the "UserControl" Object for those above line of code. It is getting the object as child. It is right thing.

Is there any solution to get the usercontrol's event and controls in thet usercontrol. If any one comes to know or knows the solution please mail me to the following id

      vijayavel_vp@rediffmail.com

and also post your code here in this forum

Cut And Paste.
Need to copy a part of a picture from the HTML screen into a picture box.
Do i have to go throught the Clipboard, or can i copy directly into the picturebox?
Examples found in help does only describe copying from a pictureclip into a picturebox. Not from an HTML screen into picturebox.

A Better Way Than Cut/paste?
Hi -
Im trying to make a new worksheet by cutting and pasting data from 2 other worksheets. I guess I was hoping theres a better way for this - can you call info from them without opening them in excel first?
Im new, please keep that in mind =)
Thank you! this forum is a livesaver


Code:
Function LastRowInColumn(intCol As Integer) As Integer

On Error GoTo LRICError

Application.Volatile
LastRowInColumn = Cells(Rows.Count, intCol).End(xlUp).Row

ExitFnxn:
Exit Function

LRICError:
LastRowInColumn = CVErr(xlErrNA)
Resume ExitFnxn

End Function




Sub SkymallExport()

Dim LastRow As Integer
LastRow = LastRowInColumn(1)
Cells(1, 1).Select
'Always SM


Windows("SalesOrderLineRet.csv").Activate
Range("J2:J7000").Select
Selection.Copy
Windows("Book1").Activate
Range("A2:A7000").Select
ActiveSheet.Paste


' action code status BN,SN,DN, etc

Windows("SalesOrderRet.csv").Activate
Range("BA2:BA7000").Select
Selection.Copy
Windows("Book1").Activate
Range("B2:B7000").Select
ActiveSheet.Paste


'Skymall order #

Windows("SalesOrderRet.csv").Activate
Range("AA2:AA7000").Select
Selection.Copy
Windows("Book1").Activate
Range("C2:C7000").Select
ActiveSheet.Paste

'Sequence number

Windows("SalesOrderRet.csv").Activate
Range("AZ2:AZ7000").Select
Selection.Copy
Windows("Book1").Activate
Range("D2:D7000").Select
ActiveSheet.Paste

'Item number
Windows("SalesOrderRet.csv").Activate
Range("AY2:AY7000").Select
Selection.Copy
Windows("Book1").Activate
Range("E2:E7000").Select
ActiveSheet.Paste


'*****************************************************8
'our own order number, column f, but we'll leave blank
'*****************************************************8

'quantity

Windows("SalesOrderLineRet.csv").Activate
Range("G2:G7000").Select
Selection.Copy
Windows("Book1").Activate
Range("G2:G7000").Select
ActiveSheet.Paste


'Shipping

Windows("SalesOrderRet.csv").Activate
Range("AJ2:AJ7000").Select
Selection.Copy
Windows("Book1").Activate
Range("I2:I7000").Select
ActiveSheet.Paste

'Tracking number

Windows("SalesOrderRet.csv").Activate
Range("BB2:BB7000").Select
Selection.Copy
Windows("Book1").Activate
Range("J2:J7000").Select
ActiveSheet.Paste

'backorder eta (not available)

Windows("Book1").Activate
Cells(1, 1).Select
Cells(1, 1).Value = "ACM"

'add today's date in Column H yyyymmdd

Range("H2:H" & LastRow).Value = Date


End Sub
PS - Cant get the lastrowincolumn function to work properly as well. Stops printing date at first 2 cells of a given column when i call it, rather that the last one.

Code:
Range("H2:H" & LastRow).Value = Date

Cut && Paste
Code:
Range("O" & x).Select
Application.CutCopyMode = False
Selection.cut
Range("N" & x).Select
ActiveSheet.Paste
Why doesn't this work x=2 yet it doesn't paste. It cuts but doesn't paste. :@ Any help will be really appreciated!

How To Paste From VB App To Another
how do i make my VB app to paste a plain text to another running app.? to the current cursor position there is fine.

also, if it is possible - lets say the "other" app is a Notepad and i have a word highlighted there. anyway for my VB app to know what the highlighted string is and replace it w/ another one?

tia!

Cut And Paste
I have a textfile named cdrec-log.txt at drive C. Can someone give me a sample code, to put on my form load, which will automatically cut and paste this textfile in a floppy disk without any further actions? (My floppy disk drive is A)

Thank you.

Cut And Paste
i am just doing small useless projects to keep for future reference.

can anybody tell me the best way to cut files which are in a predefined folder then paste them back.


thanks
thingimijig.

SQL For Cut/paste?
i need to cut data between two inputted dates from one table and paste into another table in the same database (Access). i have the text boxes for the user to enter dates txtFrom.Text & txtTo.Text. I know how to open/close connections in SQL, but how do i go about cut/paste? the data needs to go from the pmdata table to the pmhistory table. thanks for the help!

Paste API ?
Well things were going really well.

No longer do i have struggle to get a drag and drop emulation working.

As i stated before i have a list of file paths in an array and i wanted to pass these filepaths direct to another applications listview (which accepts drag and drop).

Anyway i discovered the listview in this application supports copying files from explorer then pasting into it.

So i thought about how todo this. I done a search on the internet (google) and came up with this code that works a treat:

http://www.developerfusion.com/show/224/

Anyway. If i copy my files using this code then try and send the paste API to the listview of the application it dosent work. I have tried EVERYTHING. I have tried setting focus of the app, sending sendkeys, tried almost every API possible.

Anyway if i run my program, copy all the files (using the code in the link above) then go into the other application and press Ctrl+V it works perfectly??

But using sendkeys or any API it just dosent paste.

Anyone got any ideas? Does WM_PASTE only support text and not files? why is sendkeys not working?

I need help on this one folks its really annoying now.

Can Paste?
Having a bit of trouble, wondered if anyone had any ideas:

I'm setting up the enable/disable routine for a standard edit menu. So for each of the standard cases (Cut, Copy, Paste, and Undo) I need to determine if the menu item should be enabled or disabled.

The problem is (for reasons beyond my control) the only information I have about the current control is its window handle. The control can be of any type.

Undo was easy enough: EM_CANUNDO works for Edit and RichEdit controls.

For Cut and Copy, I use EM_GETSEL to see if there is selected text. If not, the menu items are disabled.

Paste, though, has me stumped. Is there a simple test I can use to determine if Paste should be allowed? It can't change the undo stack.

Thanks!

[EDIT FOLLOWS]

At the moment, I'm checking to see if the clipboard contains paste-able text, but it still shows that I can paste in comboboxes which don't allow it.

Paste, Outside Of App
hi, i have a cmd button and a timer when i click the cmd button the timer is activated and i want the timer to paste the text thats in the clipboard every 10 seconds hense the Interval on the Timer is 10000.

Iv tryed a few codes but this doesnt seem to be working.

Kind Rgrds William

Cut And Paste
I need to be able cut and paste from one rich text box to another. Is that difficult to do in code ? Is it a default property of the control ? Any pointers on this would be much appreciated.

Thanks in advance

Cut And Paste
i am just doing small useless projects to keep for future reference.

can anybody tell me the best way to cut files which are in a predefined folder then paste them back.


thanks
thingimijig.

Cut-n-paste
Here's one that sure to get the mind going. If you run an application that disables the cut-n-paste feature, is there a program out there that can block it?
Dan jamaica125@msn.com

Copyright 2005-08 www.BigResource.com, All rights reserved