Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Questions KS Excel Discussion (Misc queries) 3 June 18th 09 06:13 PM
Newbie Questions ? Robert11[_3_] New Users to Excel 2 February 5th 09 04:12 PM
newbie questions Eric[_26_] Excel Programming 4 December 29th 04 08:08 PM
newbie questions Eric Excel Worksheet Functions 1 December 14th 04 04:39 PM
Newbie VBA questions Brian Vallelunga Excel Programming 4 October 4th 04 06:21 PM


All times are GMT +1. The time now is 11:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"