Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie questions - probably simple
Hi!
I have an excel doc, with a button, for which I need to know: I need to open another file, which I like this Workbooks.Open ("C:\test\somefile.xls") - Is there a way that I can prompt for the filename? The I copy data from that into my document. Like this Workbooks(1).Sheets(1).Cells(i, j) = Workbooks(2).Sheets(1).Cells(i, j) Workbooks(1).Sheets(1).Cells(i, j).Font.Bold = Workbooks(2).Sheets(1).Cells(i, j).Font.Bold - How can I copy the widths of the cells, and the border (if any)? And finally: Is there a way to delete an entite row? (or coloumn?) Is there a way to move/copy a row or coloumn? BR Sonnich |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie questions - probably simple
"Sonnich" wrote in message oups.com... Hi! I have an excel doc, with a button, for which I need to know: I need to open another file, which I like this Workbooks.Open ("C:\test\somefile.xls") - Is there a way that I can prompt for the filename? Look at GetOpenFilename in VBA Help The I copy data from that into my document. Like this Workbooks(1).Sheets(1).Cells(i, j) = Workbooks(2).Sheets(1).Cells(i, j) Workbooks(1).Sheets(1).Cells(i, j).Font.Bold = Workbooks(2).Sheets(1).Cells(i, j).Font.Bold - How can I copy the widths of the cells, and the border (if any)? Workbooks(1).Sheets(1).Cells(i, j).Copy Workbooks(2).Sheets(1).Cells(i, j).Paste PasteSpecial:=xlPasteAll |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie questions - probably simple
I need to open another file, which I like this
Workbooks.Open ("C:\test\somefile.xls") - Is there a way that I can prompt for the filename? Look at GetOpenFilename in VBA Help Thanks that worked The I copy data from that into my document. Like this Workbooks(1).Sheets(1).Cells(i, j) = Workbooks(2).Sheets(1).Cells(i, j) Workbooks(1).Sheets(1).Cells(i, j).Font.Bold = Workbooks(2).Sheets(1).Cells(i, j).Font.Bold - How can I copy the widths of the cells, and the border (if any)? Workbooks(1).Sheets(1).Cells(i, j).Copy Workbooks(2).Sheets(1).Cells(i, j).Paste PasteSpecial:=xlPasteAll It works,, but I resizes all the cells into something odd, even the height changes. Besides it does not look good when working. I found this to work, but I still need to get the coloumn widths correctly. Workbooks(2).Sheets(1).Range("a1:h31").Copy (Workbooks(1).Sheets(1).Range("a1")) BESIDES, I'd like to know: 1) how can I delete an entire row (e.g. 16)? 2) how do I know the size of my sheet? For some H is the last one used, for others I or L. There must be a function for this. 3) is there a way to move an entire coloumn, or insert one? Or to delete one (same as row I asume)? BR Sonnich |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie questions - probably simple
I can answer 1 and 3 easily enough: 1) Rows("16:16").EntireRow.Delete 2) I'll let someone else explain this one. My methods for this ar very primative. 3) Columns("E:E").EntireColumn.Insert Columns("H:H").EntireColumn.Cu Destination:=Columns("E:E").EntireColumn. _ EntireColumn Hope that helps. -Ikaabod Sonnich Wrote: BESIDES, I'd like to know: 1) how can I delete an entire row (e.g. 16)? 2) how do I know the size of my sheet? For some H is the last on used, for others I or L. There must be a function for this. 3) is there a way to move an entire coloumn, or insert one? Or to delete one (same as row I asume)? BR Sonnic -- Ikaabo ----------------------------------------------------------------------- Ikaabod's Profile: http://www.excelforum.com/member.php...fo&userid=3337 View this thread: http://www.excelforum.com/showthread.php?threadid=53555 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Newbie questions - probably simple
One more to go...
I can set a string, but how do I set a number as it was a string, like: Workbooks(1).Sheets(1).Cells(i, j) = "Hello world" and Workbooks(1).Sheets(1).Cells(i, j) = "1." ' this is some kind of header BR Sonnich |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Newbie Questions | Excel Discussion (Misc queries) | |||
Newbie Questions ? | New Users to Excel | |||
newbie questions | Excel Programming | |||
newbie questions | Excel Worksheet Functions | |||
Newbie VBA questions | Excel Programming |