自动格式化行/列vba

时间:2018-06-13 17:15:30

标签: excel vba

我正在编写此代码,我遇到了自动格式化行和列的困难。问题出在下面的AUTOFIT评论中。我想格式化第一行(标题),然后自动格式化整个表格。我可以通过范围函数(键入单元格的确切范围)来完成它,但我想像我在代码中间的复制粘贴一样自动完成。特别是我想将第一行用蓝色格式化,整个表格用白色连续边框格式化。

我尝试了很多不同的命令,但每次都会给我一个错误。一些线索?

$sql = $this->db->prepare("SELECT
p.first_name AS player_first_name,
p.last_name AS player_last_name,
COUNT(*) AS goal_scored,
CASE g.type
  WHEN 1 THEN 'first_goal'
  WHEN 2 THEN 'goal'
  WHEN 3 THEN 'pg'
  WHEN 4 THEN 'og'
END AS goal_type,
p.id AS player_id
FROM `match` m
INNER JOIN goal g ON g.match_id = m.id
INNER JOIN player p ON g.player_marker_id = p.id
WHERE m.round_id = :round_id AND g.type != 4
GROUP BY p.id
ORDER BY goal_scored DESC, player_last_name DESC");

0 个答案:

没有答案